I was reading some code for a js library and I saw this:
// make sure undefined is undefined
var undefined;
I have looked up the proper way to check for undefined things in javascript a few times before and found posts such as:
- How to check for "undefined" in JavaScript?
- How to determine if variable is 'undefined' or 'null'?
- typeof !== "undefined" vs. != null
- Detecting an undefined object property
Is that piece of code a good thing to add on or is it unnecessary or something in the middle?