myInt = parseInt(myString, 10);
document.write("\"" + myString +
"\" when converted to an integer equals " + myInt + "<br/>");
Having trouble getting a full understanding of the backslash escape character. For example, the above code without printing the value of myString with quotes around it could be written as (to my understanding):
myInt = parseInt(myString, 10);
document.write( myString +
" when converted to an integer equals " + myInt + "<br/>");
Ok, so, as shown in the first code example, to add literal quotes you would add \" to each side of ' + myString + '. But why the pair of quotes around ' + myString + ', within the two \" escape characters. Why is it not enough to just add the two backslash characters around myString? Why must there be another pair of quotes within that?
Perhaps, as an example, if someone could show how to add literal quotes to the value of myInt, just as was done to myString? I couldn't get that right after several tries.