It’s mainly horrid, because it means you have to code extremely defensively (or I guess, use a different API).
You can’t rely on new Date("not a date")
aborting execution of your function by throwing an error. Instead, you have to know that it can produce an Invalid Date
object and check for that. Otherwise a random NaN
shows up during execution, which is gonna be extremely fun to try to find the source of.
I understand that it’s implemented like that partially for historical reasons, partially because it’s often better to display “NaN” rather than nothing, but it’s still the sort of behavior that puts me in a cold sweat, because I should be memorizing all kinds of Best Practices™ before trying to code JavaScript.
Hab vor 'ner Weile im Laden “Ameisen-Buffet” gesehen und dachte, krass, hätte nicht gedacht, dass das schon im Mainstream angekommen ist, dass die Ameisen in Deutschland aktuell hart am Aussterben sind, so dass es genug Interesse an einem Produkt wie dem Bienenhotel nur eben für Ameisen gibt.
Ja, es war Gift.