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
Post a Comment