Open rauschma opened 6 years ago
You mixed the values of Number.MIN_SAFE_INTEGER
and Number.MAX_SAFE_INTEGER
in 15.11.3. Safe integers
@ivansvlv Thanks! This will be fixed in the next release.
@Flooorent Thanks, the next release will fix this!
I have the for-purchase digital version of the book, including quizzes and exercises.
Unfortunately the Numbers (advanced) quiz at the end of this chapter is missing.
@rauschma Decimal proposal is now at the stage 1. We are getting closer!
16.4 Table8
Convert the bigint like 1n
, I get 1
in browser and Node. Is there a rule in the standard?
Hi and thanks for the book! 16.9.3 should be [-2 53 + 1, 2 53 - 1] .
Dear @rauschma!
What is the reason for using +0
, but not 0
? For example, in "Table 8: Converting values to numbers."
Dear @rauschma! What is the reason for using
+0
, but not0
? For example, in "Table 8: Converting values to numbers."
@SiarheiBobryk I believe it's used to emphasize the fact that it's a positive zero not a negative one, since JavaScript has a signed zero, more info here: http://speakingjs.com/es5/ch11.html#two_zeros
@EtherNoteWorld That has changed since I initially wrote this text (and will be fixed in the next release). Relevant section in the spec: https://tc39.es/ecma262/#sec-number-constructor-number-value
@gfot2 Fixed in next release, thanks!
@SiarheiBobryk: The reason is as explained by @ivansvlv. However, in the book I’m pretending that there is only one zero (I have yet to encounter code where the difference matters). Thus, I’ll simply write 0
instead of +0
in the next release.
Section 16.11.2 Static properties of Number
It feels like .POSITIVE_INFINITY
should go before .NEGATIVE_INFINITY
, since .NEGATIVE_INFINITY
refers to description of .POSITIVE_INFINITY
.
@rauschma I think in §16.5.2 it really doesn't make any sense to include findIndex
and find
as logic is defined by the predicate ( function ) that user will write not by language, it's all up to the user whether the function they write is able to find the NaN
or not, whether they are checking using Object.is
or Number.isNaN
or just checking using strict equality or something.
14.3.3. Incrementing (++) and decrementing (--): There is a typo in the second example, highlighted should be suffix I assume: