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]


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

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS Basics
  4. JS in Depth
  5. JS Reference
  6. DOM
  7. SVG
  8. JS Misc