What's the difference between "typeof str" and "typeof(str)" in JavaScript? -


what difference between these 2 statements?

if (typeof errormessage !== undefined) {} 

and

if (typeof (errormessage) !== undefined) {} 

one of them has pair of entirely superfluous parentheses.

the difference between typeof foo , typeof (foo) same difference between 1 + 1 , (1) + (1).


an aside, typeof operator give string, should comparing "undefined" not undefined.


Comments

Popular posts from this blog

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

ruby on rails - Authlogic - how to make a registration and don't log in the new account? -