JS中判断对像样否为空

JS中判断对象是否为空if ? (typeOf(x) ? ? undefined){ ? ? ? ? alert(undefined) ? ? } ? ? else

JS中判断对象是否为空

if ? (typeOf(x) ? == ? "undefined"){ ?
? ? ? alert("undefined"); ?
? } ?
? else ? if ? (typeOf(x) ? == ? "null") ? { ?
? ? ? alert("null"); ?
? }

或者简单那的用法是

if(!variable)

{}