type coercion javascript code example
Example 1: type javascirpt
console.log(typeof 42);
Example 2: coercion javascript
const value1 = '5';
const value2 = 9;
let sum = Number(value1) + value2;
console.log(sum);
console.log(typeof 42);
const value1 = '5';
const value2 = 9;
let sum = Number(value1) + value2;
console.log(sum);