What literals return true?
(typeof %литерал% == "undefined") Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
Found two solutions to the problem
Trite but
typeof undefined == "undefined" although no one bothers to set this variable to undefined and it turns out insecure
As a result, the solution is void (0), since an attempt to declare a void function will cause an error
typeof void(0) == "undefined" Although it still turns out some zashkvar :)
undefined has long been impossible to set, and for their variables and you can follow himself. A void is not a function, but a unary operator. - Qwertiy ♦It depends on what is meant by a literal. If constant, then no.
If anything, undefined (this is a readonly property, not a constant), any undeclared variables (except for the variables in the temporal dead zone in ES6), any expressions whose values are undefined .
Well, another magical event - document.all :)
console.log(typeof undefined == 'undefined') console.log(typeof gdfsfjgsb == 'undefined') console.log(typeof void 6789 == 'undefined') console.log(typeof {}.jsdhfs == 'undefined') console.log(typeof document.all == 'undefined') console.log(document.all.length) Source: https://ru.stackoverflow.com/questions/611415/
All Articles
arguments.length- Igor