Skip to content

Instantly share code, notes, and snippets.

How many data types are there in modern JS?

There are eight basic data types in JavaScript: string, number, bigint, boolean, undefined, null, symbol, object. Here, all data types except Object are primitive data types.

// What output will the following code produce?
console.log(typeof 1); // number
console.log(typeof ''); // string
console.log(typeof {}); // object
console.log(typeof (() => {})); // function
console.log(typeof function() {}); // function
console.log(typeof true); // boolean
@gergoszka
gergoszka / hello.txt
Created October 8, 2019 12:16
Test gist
Hello, World!