What does the following code do and why? console.log(1+"2")

The code outputs the text "12" to the console, demonstrating a concatenation of a string and an integer.

TM

Related Javascript Mentoring answers

All answers ▸

What does the document.onload() function do and why is it useful?


How do you create objects in javascript?


Find the sum of all multiples of 2 less than 10000


How would you change the background colour of a div with the id "colourme" to purple?