E.g:
let name = '1234'
console.log(typeof(name));
Output: string
console.log(Number(name));
Output: number
Coercion: javascript automatically ex cutes whenever the operator deals with different format. So JavaScript converts on one of the value based upon the operator.
Not all the operator support this type corrosion. The only task failed by the type coercion.

0 Comments