javascript-data-types-background

JavaScript Data types

Do you know them all?

String
Represents sequence of characters.
e.g. “hello world”

Number
Represents numerical values.
e.g. 1000

Boolean

Represents a Boolean value, either true or false.

Undefined

Represents an undefined value.
e.g. A variable without a value.

javascript-data-types
Null

Represents no value at all. null means 'nothing'.

BigInt

BigInt is a special numeric type that provides support for integers of arbitrary length.
e.g. 1234567890123456789012345678901234567890n

Symbol

A Symbol is a unique and immutable primitive value and may be used as the key of an Object property.
e.g. Sym1 = Symbol("Sym")

Object

Objects are used to store collections of data.
e.g. emptyObject = {...}

The best thing about a boolean is even if you are wrong, you are only off by a bit.

Anonymous
Share: