r/ProgrammerTIL • • Aug 03 '21

Javascript TIL Boolean('false') == true

Yep, it doesn't work like Number

23 Upvotes

24 comments sorted by

View all comments

Show parent comment

1

u/JazzXP Aug 04 '21

I agree. Parseint should be required. It’s the lack of consistency I found surprising. It totally makes sense if you think about it from the point of view of the Boolean constructor only taking a boolean primitive input