other-languages

Martynas Maciulevičius 2021-10-02T07:20:53.014900Z

I think I love Javascript. Try evaluating this: !"" == !"text"

pavlosmelissinos 2021-10-04T14:25:27.018600Z

or this: https://jsisweird.com/

Martynas Maciulevičius 2021-10-04T18:45:22.020300Z

It's not that I like that. But what the implications of this are. Because it retains the type but it's still an empty string. And in Clojure empty string is truthy. I was doing something in JS and I was wondering why it wasn't allowed to have a empty string as a route name (long story) for a handler. And for some reason the authors check whether the string is !routeName and then throw an error (and they also write that they don't want empty strings there). Yes, I know about the batman thing and that JS has some quite strange quirks. But then you also have null and undefined... why. If empty value is falsy, why even have any concept of null...

➕ 1
2021-10-02T15:55:45.015700Z

so empty string is falsey, but a non empty string is truthy?

2021-10-02T17:08:54.015900Z

If you like that, you might also enjoy this: https://www.destroyallsoftware.com/talks/wat

💯 1
🤣 1