MDN self-hosted library · e01.org
Type coercion / notebook

Type coercion

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const value1 = "5";
const value2 = 9;
let sum = value1 + value2;

console.log(sum);
js
sum = Number(value1) + value2;