const value1 = "5";
const value2 = 9;
let sum = value1 + value2;
console.log(sum);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.
sum = Number(value1) + value2;