Expert Developer JavaScript Question: Download Expert JavaScript Developer PDF
What would "1"+2+3 and 1+2+"3" evaluate to, respectively?
Answer:
When the first character is a string, the remaining characters will be converted into a single string, rendering 123.
If the string is at the end, the initial characters will perform normal mathematical functions before converting into a string, resulting in 33.
If the string is at the end, the initial characters will perform normal mathematical functions before converting into a string, resulting in 33.
Previous Question | Next Question |
What is the disadvantages using innerHTML in JavaScript? | What is event bubbling, and why is it beneficial to use? |