JS: Primitive Value

By Xah Lee. Date: . Last updated: .

Primitive Value

A primitive value is a value whose Type is a primitive type.

The following values are Primitive Values.

Primitive Value Object Wrapper

Most primitive type have corresponding object of object type.

The object is used as primitive value wrapper. This allows you to call methods on them, such as "abc".length.

You can create number, string, boolean, objects yourself. For example:

Convert Primitive Value to Object

JavaScript. Value Types