There is some examples:
a = ''; //string
b = 0; //number 0
b1 = 0xf; //number 15
c = (function(){}) //function function (){}
d = []; //object
e = {}; //object [object Object]
f = void(0); //undefined undefined
but when I try pass undefined variable trougth function like that:
typeof qwerty; //undefined
function at(a){return (typeof a)+' '+a;}
at(qwerty); // ????
..i`v got an error "Uncaught ReferenceError: qwerty is not defined". How can I (Is the shortest way exist to) create function isDefined(a,b) or another trick to reduce that expression?:
c=(typeof a!='undefined'&&a||b)
Clarification: If a is defined - c equals a, overwise - b, like "c=@a?:b" in php
Edit:
function ud(_a){return typeof window[_a]==='undefined'}
a=undefined; b=3;
alert((ud('a')?4:a)+(ud('b')?5:b));