๐Ÿ”
๐Ÿ‘ถ Kids๐Ÿ“ Blog About Contact ๐Ÿš€ Get Started Free

JS Data Types

JavaScript variables can hold different data types: strings, numbers, booleans, objects, arrays, and more.

JavaScript is dynamically typed โ€” a variable can hold any type of data, and the type can change at runtime. Use typeof to check any variableโ€™s type.

Try It โ€” All Data Types

Preview

Data Types at a Glance

TypeExampletypeof result
String"Hello""string"
Number42, 3.14"number"
Booleantrue, false"boolean"
Undefinedlet x;"undefined"
Nullnull"object" (JS quirk)
Object{ key: value }"object"
Array[1, 2, 3]"object"

Tip: Arrays are technically objects in JavaScript. Use Array.isArray(value) to reliably test if something is an array.