Compound addition assignment operator treating quoted numbers as . . . numbers?
up vote
0
down vote
favorite
So I'm reading a book on JavaScript called JavaScript: The Web Warrior Series. In the book, they state that the compound addition assignment operator treats quoted numbers as numbers, not as strings, combining their values, not concatenating them. Testing this in Google Chrome, I discovered this to be incorrect. Has there ever been a browser whose JavaScript interpreter processes a quoted number as a number through the compound addition assignment operator?
Thanks!!! :)
javascript string browser numbers interpreter
add a comment |
up vote
0
down vote
favorite
So I'm reading a book on JavaScript called JavaScript: The Web Warrior Series. In the book, they state that the compound addition assignment operator treats quoted numbers as numbers, not as strings, combining their values, not concatenating them. Testing this in Google Chrome, I discovered this to be incorrect. Has there ever been a browser whose JavaScript interpreter processes a quoted number as a number through the compound addition assignment operator?
Thanks!!! :)
javascript string browser numbers interpreter
1
The page you're referencing can be found on the first link here. The book is just plain wrong, though, that would violate the official specification and would surely break many scripts. It would also be clearer to use the word "concatenate" rather than "combine" when referring to putting two strings together to form a single longer string.
– CertainPerformance
Nov 11 at 6:18
Thanks for the information! I used the word "combining" because the book said that the compound assignment operator treats quoted numbers as numbers, not strings, which would get concatenated by the addition operator. Now I know for sure that the compound addition assignment operator treats quoted numbers as strings, concatenating them, not combing their values! (-:
– Xyce Bedet
Nov 11 at 6:31
Yep, definitely a problem with the book, not with the person trying to learn from the book :P
– CertainPerformance
Nov 11 at 6:34
It is interesting that a book that is used in colleges can be so grossly wrong like that.
– Xyce Bedet
Nov 11 at 6:39
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
So I'm reading a book on JavaScript called JavaScript: The Web Warrior Series. In the book, they state that the compound addition assignment operator treats quoted numbers as numbers, not as strings, combining their values, not concatenating them. Testing this in Google Chrome, I discovered this to be incorrect. Has there ever been a browser whose JavaScript interpreter processes a quoted number as a number through the compound addition assignment operator?
Thanks!!! :)
javascript string browser numbers interpreter
So I'm reading a book on JavaScript called JavaScript: The Web Warrior Series. In the book, they state that the compound addition assignment operator treats quoted numbers as numbers, not as strings, combining their values, not concatenating them. Testing this in Google Chrome, I discovered this to be incorrect. Has there ever been a browser whose JavaScript interpreter processes a quoted number as a number through the compound addition assignment operator?
Thanks!!! :)
javascript string browser numbers interpreter
javascript string browser numbers interpreter
asked Nov 11 at 6:15
Xyce Bedet
266
266
1
The page you're referencing can be found on the first link here. The book is just plain wrong, though, that would violate the official specification and would surely break many scripts. It would also be clearer to use the word "concatenate" rather than "combine" when referring to putting two strings together to form a single longer string.
– CertainPerformance
Nov 11 at 6:18
Thanks for the information! I used the word "combining" because the book said that the compound assignment operator treats quoted numbers as numbers, not strings, which would get concatenated by the addition operator. Now I know for sure that the compound addition assignment operator treats quoted numbers as strings, concatenating them, not combing their values! (-:
– Xyce Bedet
Nov 11 at 6:31
Yep, definitely a problem with the book, not with the person trying to learn from the book :P
– CertainPerformance
Nov 11 at 6:34
It is interesting that a book that is used in colleges can be so grossly wrong like that.
– Xyce Bedet
Nov 11 at 6:39
add a comment |
1
The page you're referencing can be found on the first link here. The book is just plain wrong, though, that would violate the official specification and would surely break many scripts. It would also be clearer to use the word "concatenate" rather than "combine" when referring to putting two strings together to form a single longer string.
– CertainPerformance
Nov 11 at 6:18
Thanks for the information! I used the word "combining" because the book said that the compound assignment operator treats quoted numbers as numbers, not strings, which would get concatenated by the addition operator. Now I know for sure that the compound addition assignment operator treats quoted numbers as strings, concatenating them, not combing their values! (-:
– Xyce Bedet
Nov 11 at 6:31
Yep, definitely a problem with the book, not with the person trying to learn from the book :P
– CertainPerformance
Nov 11 at 6:34
It is interesting that a book that is used in colleges can be so grossly wrong like that.
– Xyce Bedet
Nov 11 at 6:39
1
1
The page you're referencing can be found on the first link here. The book is just plain wrong, though, that would violate the official specification and would surely break many scripts. It would also be clearer to use the word "concatenate" rather than "combine" when referring to putting two strings together to form a single longer string.
– CertainPerformance
Nov 11 at 6:18
The page you're referencing can be found on the first link here. The book is just plain wrong, though, that would violate the official specification and would surely break many scripts. It would also be clearer to use the word "concatenate" rather than "combine" when referring to putting two strings together to form a single longer string.
– CertainPerformance
Nov 11 at 6:18
Thanks for the information! I used the word "combining" because the book said that the compound assignment operator treats quoted numbers as numbers, not strings, which would get concatenated by the addition operator. Now I know for sure that the compound addition assignment operator treats quoted numbers as strings, concatenating them, not combing their values! (-:
– Xyce Bedet
Nov 11 at 6:31
Thanks for the information! I used the word "combining" because the book said that the compound assignment operator treats quoted numbers as numbers, not strings, which would get concatenated by the addition operator. Now I know for sure that the compound addition assignment operator treats quoted numbers as strings, concatenating them, not combing their values! (-:
– Xyce Bedet
Nov 11 at 6:31
Yep, definitely a problem with the book, not with the person trying to learn from the book :P
– CertainPerformance
Nov 11 at 6:34
Yep, definitely a problem with the book, not with the person trying to learn from the book :P
– CertainPerformance
Nov 11 at 6:34
It is interesting that a book that is used in colleges can be so grossly wrong like that.
– Xyce Bedet
Nov 11 at 6:39
It is interesting that a book that is used in colleges can be so grossly wrong like that.
– Xyce Bedet
Nov 11 at 6:39
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246336%2fcompound-addition-assignment-operator-treating-quoted-numbers-as-numbers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
The page you're referencing can be found on the first link here. The book is just plain wrong, though, that would violate the official specification and would surely break many scripts. It would also be clearer to use the word "concatenate" rather than "combine" when referring to putting two strings together to form a single longer string.
– CertainPerformance
Nov 11 at 6:18
Thanks for the information! I used the word "combining" because the book said that the compound assignment operator treats quoted numbers as numbers, not strings, which would get concatenated by the addition operator. Now I know for sure that the compound addition assignment operator treats quoted numbers as strings, concatenating them, not combing their values! (-:
– Xyce Bedet
Nov 11 at 6:31
Yep, definitely a problem with the book, not with the person trying to learn from the book :P
– CertainPerformance
Nov 11 at 6:34
It is interesting that a book that is used in colleges can be so grossly wrong like that.
– Xyce Bedet
Nov 11 at 6:39