(no title)
protester | 11 years ago
The second line at least uses type coercion, but still you are making the wrong assumptions. true could be coerced to many strings 't', '1', 'true', 'yes', 'on', but they chose to use '1' (You may not like it but I think it's a good choice). Infinity on the other hand has not many choices when coercing it to a string I can think of '∞' (which is difficult to type), 'Infinity', and maybe 'Inf.' so I think they made a good choice here.
I'm not saying type coercion in js has no problems, but you said that it's a mess and I just think you chose the wrong examples.
No comments yet.