const weight = 78.5; const grades = 98; const remainder = 80 % 4; console.log(weight); // prints 78.5 console.log(grades); // prints 98 console.log(remainder); // 0 console.log(typeof weight); // prints number console.log(typeof grades); // prints number console.log(typeof remainder); // prints number
Infinity, -Infinity and NaN
const value = 65 / 0; const data = -65 / 0; const result = ‘hello’ / 10; console.log(value); // prints Infinity console.log(data); // prints -Infinity console.log(result); // prints NaN
Get hands-on experience writing code with interactive tutorials in our free online learning platform.
- Free and fun
- Designed for beginners
- No downloads or setup required