Fork me on GitHub
Martynas M07:10:53

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


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


If you like that, you might also enjoy this:

💯 1
Martynas M18:10:22

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...