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

php - cannot display multiple markers in google maps v3 from traceroute result -

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

javascript - firefox memory leak -