News for hackers. Stuff that matters.
Re:Show HN: Ezno, a type checker for JavaScript and optimise... by davidzweig on Friday September 23, 2022 @06:53PM (#32958021)
We do it like this: https://imgur.com/a/AdeRncw

Just a simple function (ensureType) that checks primitive types (angle brackets for min length). You reconstruct the object using ensureType, writing it back into itself. EnsureType returns what is passed in, with the corresponding type. Has worked well.

There are no comments on this comment yet.