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!!! :)










share|improve this question

















  • 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














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!!! :)










share|improve this question

















  • 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












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!!! :)










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線