What is the output of "10"+20+30 in JavaScript?

Forums JavaScriptWhat is the output of "10"+20+30 in JavaScript?
Staff asked 2 years ago

Answers (1)

Add Answer
Nayan Raval Marked As Accepted
Staff answered 2 years ago

102030 because after a string all the + will be treated as string concatenation operator (not binary +).

function display()  
{  
  document.writeln("10"+20+30);  
}  
display();

 

Subscribe

Select Categories