JS: Primitive Value

By Xah Lee. Date: . Last updated: .

Primitive Value

The following values are called “Primitive Value”.

They are also called primitive types.

[see JS: Value Types]

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 or (34).toString().

You can create number, string, boolean, objects yourself. (but they are rarely needed.)

For example:

new String(arg) [see JS: String Constructor]

new Number(arg) [see JS: Number Constructor]

new Boolean(arg) [see JS: Boolean Constructor]

Reference

ECMAScript 2015 §Overview#sec-primitive-value

JS Types Topic

  1. JS: Value Types
  2. JS: Primitive Value
  3. JS: Object Type
  4. JS: “typeof” Operator
  5. JS: Determine Type of Object
  6. JS: Object.prototype.isPrototypeOf
  7. JS: Property Key “constructor”
  8. JS: “instanceof” Operator
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

Ask me question on patreon