4 ms·
try/catch messing with const is a well known problem in modern JS & one that imo needs a generalised solution & not one specific to one constructor. As far as
by lucideer 2y ago
try/catch messing with const is a well known problem in modern JS & one that imo needs a generalised solution & not one specific to one constructor.
As far as other error return patterns existing in "the spec" - there are multiple specs referred to here (ECMA vs DOM) & also multiple eras; there seems to be consensus that some past patterns on error return weren't great decisions & some well considered consensus to move to more broadly accepted known patterns (like try/catch).
e.g. for your Date example, that's a really old API that ECMA are working on replacing with Temporal (which throws)