The New Mathlemmy.mlimage ☆ Yσɠƚԋσʂ ☆ ( @yogthos@lemmy.ml ) Programmer Humor@lemmy.ml • 2 years ago message-square10fedilinkarrow-up129
arrow-up129imageThe New Mathlemmy.ml ☆ Yσɠƚԋσʂ ☆ ( @yogthos@lemmy.ml ) Programmer Humor@lemmy.ml • 2 years ago message-square10fedilink
minus-square Ephera ( @Ephera@lemmy.ml ) linkfedilink4•2 years ago…but why? This looks like it would never be expected behavior. Like a bug in the implementation, which can simply be fixed.
minus-square Ephera ( @Ephera@lemmy.ml ) linkfedilink9•2 years agoOh no, it’s even documented on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#using_parseint
minus-square enebe ( @enebe@lemmy.ml ) linkfedilink2•2 years agoSweet Flying Spaghetti Monster, that’s horrible. I’m guessing the reason is to keep the truth value equivalent when casting to boolean, but there has to be a more elegant way…
minus-square Ephera ( @Ephera@lemmy.ml ) linkfedilink2•2 years agoMight be, but this is also a decent explanation: https://lemmy.ml/post/464637/comment/272066
…but why? This looks like it would never be expected behavior. Like a bug in the implementation, which can simply be fixed.
Oh no, it’s even documented on MDN:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#using_parseint
Sweet Flying Spaghetti Monster, that’s horrible. I’m guessing the reason is to keep the truth value equivalent when casting to boolean, but there has to be a more elegant way…
Might be, but this is also a decent explanation: https://lemmy.ml/post/464637/comment/272066