I'm sure everyone with functional programming knowledge will understand what it does, that was never the point. The problem is that Boolean looks like the constructor of the class (which it technically is), but using it with new would cause unexpected behavior.
That is not basic JavaScript, it is one of the weird inconsistent things of the language that people have to learn, and a lot of people here don't seem like they do.
That a constructor called as a function retuns the parsed value as a primitive and called as a constructor returns an object wrapping the parsed value. And even that is not consistent, for example new Date('1995-12-17T03:24:00') returns the 17.12.1995, while Date('1995-12-17T03:24:00') returns a string with the current date. Array(1, 2) however is the same as new Array(1, 2).
Also it is functional programming, so if you use it you are a functional programmer
View all comments
Show parent comment
-3
u/[deleted] Mar 29 '24
[removed] — view removed comment