Note, that the Number rounding of floats in JavaScript is not accurate
(0.1 + 0.2) === 0.3 // false
Since this rounding affects integer representation, too, you should also consider Number.isSafeInteger
Number.isSafeInteger
developer.mozilla.org/en-US/docs/W...
Also please consider Integer boundaries in JS, that are represented by Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER
Number.MAX_SAFE_INTEGER
Number.MIN_SAFE_INTEGER
Edit: sry wanted to post on top level, somehow ended up as comment on yours
Awesome, thanks Jan!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Note, that the Number rounding of floats in JavaScript is not accurate
Since this rounding affects integer representation, too, you should also consider
Number.isSafeInteger
developer.mozilla.org/en-US/docs/W...
Also please consider Integer boundaries in JS, that are represented by
Number.MAX_SAFE_INTEGER
andNumber.MIN_SAFE_INTEGER
developer.mozilla.org/en-US/docs/W...
developer.mozilla.org/en-US/docs/W...
Edit: sry wanted to post on top level, somehow ended up as comment on yours
Awesome, thanks Jan!