Closed fireattack closed 3 years ago
It looks like a mistake from merging code. Checkout this https://github.com/denysdovhan/wtfjs/tree/c2b38a183a6c13c8ceb44eb1e55238d17875e95c#precision-of-01--02 The original version should be like you written:
0.1 + 0.2 // -> 0.30000000000000004
(0.1 + 0.2) === 0.3 // -> false
You can submit Pull Requests.
It looks to me someone ran a formatter with all the code and messed up lots of things (see also "Destructuring with default values" etc.) I will see if I can fix it as much as I can.
:tada: This issue has been resolved in version 1.13.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Lots of examples in the article have weird parentheses in it and I'm not sure what they are for.
Example: https://github.com/denysdovhan/wtfjs#precision-of-01--02
What's the purpose of parentheses here? It doesn't generate valid code (
Uncaught TypeError: 0.2 is not a function at <anonymous>:2:6
), nor make it easier to read (compared to just). I read the "notation" at the beginning and didn't find anything relevant either.
There are plenty of others, e.g.
https://github.com/denysdovhan/wtfjs#patching-numbers
.. and so on.