Data Types
1. Number Type
console.log(1 / 0); // Infinityconsole.log(Infinity); // Infinityconsole.log('not a number' / 2); // NaN
2. BigInt
const bigInt = 123456789123456789n;
3. String Type
let str = 'Hello'; // double quotes let str2 = 'Ella Yeonsu Choi'; // single quotes let phrase = `Nice to meet you`; // backtickslet name = 'Ella'; // Insert variable in the middle of string console.log(`Hello, ${name}!`); // Hello, Ella! // Insert expression in the middle of string console.log(`the result is ${1 + 2}`); // the result is 3
4. Boolean Type
5. null Value
6. undefined Value
7. Objects and Symbols
8. typeof Operator
Last updated