JavaScript: Primitive Value Object Wrapper

By Xah Lee. Date: . Last updated: .

What's Primitive Value?

Primitive value is one of the following:

Sometimes they are called primitive types.

〔►see JavaScript: Data Types

ECMAScript 2015 §Overview#sec-primitive-value

String or number are not objects, why do they have methods?

When using a method of a number (or string), the primitive value is automatically converted to object temporarily.

you can create number or string objects yourself. (but they are rarely needed.)

new String(arg)

new Number(arg)

new Boolean(arg)

Object and Inheritance Topic

  1. JavaScript: Object System Overview
  2. JavaScript: What's Object?
  3. JavaScript: Prototype and Inheritance
  4. JavaScript: Creating Object
  5. JavaScript: Object Literal Expression {…}
  6. JavaScript: Find Object's Prototype
  7. JavaScript: How to Create Object with Parent X?
  8. JavaScript: Prevent Adding Property
  9. JavaScript: Determine Type of Object
  10. JavaScript: Primitive Value Object Wrapper
  11. JavaScript: Clone, Deep Copy Object/Array
  12. JavaScript: Test Equality of Objects

  1. JavaScript: Object Object
  2. JavaScript: Object.prototype
Like what you read? Buy JavaScript in Depth
or, buy a new keyboard, see Keyboard Reviews.