3 ms·
"The difference between a bug and a feature is longevity." -said by someone last millennium
by readthenotes1 4y ago
"The difference between a bug and a feature is longevity."
-said by someone last millennium
- bryanrasmussen 4y agothat's wrong, but it's been around so long I guess we have to accept it.
- abdnafees 4y agoAfter asking the question, I looked for an answer and found the is-object npm package. It utilizes a null check to make sure a variable is an object. This utility has 6.6 million weekly downloads. The logic in the isObject function will break because the second condition would then be invalidated. Resulting in a bad day for 6.6 million projects. It took me a while to digest the magnitude. Maybe because I just started as an SWE.
- andrewmackrodt 4y agoIf a language change were to update `typeof null` to return `"null"` isObject would not break, the second condition would only be unnecessary. However, other code which may make assertions on null values after checking the value is an object would break.
- white_dragon88 4y ago[dead]