Re:The many faces of undefined in JavaScript
by demurgos on Wednesday June 26, 2024 @08:04AM
(#40798991)
As mentioned in the article, you can declare a binding named `undefined` and assign a value to it. This shadows the base `undefined` binding (since it's NOT a keyword).
`void 0` ensures that you get the `undefined` value regardless of any shadowing that may be happening with the `undefined` binding.
`void 0` ensures that you get the `undefined` value regardless of any shadowing that may be happening with the `undefined` binding.