Coercion

Is converting a value from one type to another.

This happens quite often in javascript because it’s dynamically typed.

//Example: var a = 1+ "2"; console.log(a); // answer 12 not 2

The first parameter coerces by javascript engine as a string.

When you can call a + operator and add a string to a number the javascript engine will convert the number to a string. The javascript will not ask you to coerce the value but this is default by the javascript. But this will not give an error in javascript. But it does in other languages.

Happy coding :)!