最佳答案
我尝试过的一些事情似乎并不奏效:
if(lastName != "undefined")
if(lastName != undefined)
if(undefined != lastName)