To write exponents in JavaScript, use the
**
operator like so: A ** B
.Here's how you do it:
const oneKb = 2 ** 10;
console.log(oneKb); // 1024
Math.pow
function:const oneKb = Math.pow(2, 10);
console.log(oneKb); // 1024