Expert Developer JavaScript Question:
Download Questions PDF

What would "1"+2+3 and 1+2+"3" evaluate to, respectively?

Expert JavaScript Developer Interview Question
Expert JavaScript Developer Interview Question

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.

Download Expert JavaScript Developer Interview Questions And Answers PDF

Previous QuestionNext Question
What is the disadvantages using innerHTML in JavaScript?What is event bubbling, and why is it beneficial to use?