I've been bitten by for-of needing a value so many times
for (const k in objectOrNullish) {} // It's cool, no worries
for (const v of arrayOrNullish) {} // Oh noes errors
My code is full of:
if (arrayOrNullish) {
for (const v of arrayOrNullish) {}
}
-
Show this thread
-
-
This is what
@mathias 's spec change proposed but tc39 shot it down1 reply 0 retweets 1 like -
I can imagine the arguments against it, but not sure i agree with them.
1 reply 0 retweets 0 likes
For context: https://github.com/tc39/ecma262/pull/1069 … Let me know if you have any thoughts
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.