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?


What is the difference between global and local variables?


I've just heard about objects. How do I use them and do they work with Arrays?


What is the difference between let and var when declaring variables in javascript?