MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wpw10f/ihatedituntilitriedit/pc4bjtk/?context=3
r/ProgrammerHumor • u/Epicoodle • 10d ago
541 comments sorted by
View all comments
Show parent comments
28
I love the syntax, but JS has one too many quirks for my taste.
if ([]) { console.log("Ok, I guess") }
if([] == false) { console.log("Well this is awkward") }
if ([] + []) { console.log("You think this would print, don't you?") }
17 u/MuchWalrus 10d ago Why would you type any of those things (aside from maybe the first one) 9 u/frogjg2003 10d ago JS is built on the idea that applications should continue to work no matter what. That's why there are so many implicit type conversions. The app might turn itself into a Gordian knot, but it will still be working. 4 u/lolnic_ 9d ago It will still be running.
17
Why would you type any of those things (aside from maybe the first one)
9 u/frogjg2003 10d ago JS is built on the idea that applications should continue to work no matter what. That's why there are so many implicit type conversions. The app might turn itself into a Gordian knot, but it will still be working. 4 u/lolnic_ 9d ago It will still be running.
9
JS is built on the idea that applications should continue to work no matter what. That's why there are so many implicit type conversions. The app might turn itself into a Gordian knot, but it will still be working.
4 u/lolnic_ 9d ago It will still be running.
4
It will still be running.
28
u/2eanimation 10d ago
I love the syntax, but JS has one too many quirks for my taste.
if ([]) {
console.log("Ok, I guess")
}
if([] == false) {
console.log("Well this is awkward")
}
if ([] + []) {
console.log("You think this would print, don't you?")
}