Visa Inc. Interview Question

What will this code output? console.log("122" + 344)

Interview Answer

Anonymous

Dec 9, 2017

The second operand is coerced into the type of the first operand in JS. So in this case, since the first operand is a string, the second one becomes a string. So "122" + "344" --> 122344

2