undefined
is not a JavaScript keyword, it is a property of global object, i.e., it is a
variable in global scope.
You
can shadow the global property undefined in local scope.
HelloWorld.js
function print_me () { console.log(undefined) var undefined = "shadowed"; console.log(undefined); } print_me();
Output
undefined
shadowed
No comments:
Post a Comment