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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -