JavaScriptBeginner#fundamentals#types

What are the data types in JavaScript?

Seven primitives — string, number, bigint, boolean, undefined, symbol, null — plus the object type (which covers arrays, functions, dates and plain objects). Primitives are immutable and copied by value; objects are copied by reference.

Example
typeof 'hi';        // 'string'
typeof 10n;         // 'bigint'
typeof null;        // 'object' (historic bug)
typeof [];          // 'object'
typeof function(){} // 'function'

Related Questions

1
JavaScriptBeginner#scope#es6

Difference between var, let and const?

Open
2
JavaScriptBeginner#scope

What is hoisting?

Open
3
JavaScriptIntermediate#closures#functions

What is a closure?

Open