Member-only story
JavaScript Is Getting a Major Upgrade: 4 ES2027 Features Developers Should Know
JavaScript is evolving fast. Here’s a simple guide to Temporal, using, Iterator.zip(), Atomics.pause(), and the proposals that could shape the future of the language.
JavaScript has a strange talent for turning simple-looking code into something that makes you question reality.
Dates are probably the best example.
Consider these two expressions:
new Date(0)
new Date("0")You might expect both to represent Unix epoch time: January 1, 1970.
They do not.
With the numeric value 0, JavaScript treats the argument as a timestamp measured in milliseconds from the Unix epoch. But "0" is a string, so JavaScript sends it through its date-string parsing rules. In common modern browsers such as Chrome and Safari, "0" is interpreted as January 1, 2000. The exact behavior of non-standard date strings can vary between JavaScript engines, which is one reason legacy Date parsing is so frustrating.
And it gets even stranger:
Date.parse(0)
Date.parse("0")









