Class: Object

barejs/polyfill.Object()

new Object()

Polyfills for Object. Module that provides implementations for methods missing on Object. Methods that cannot be polyfilled close enough to the spec (since they rely on Native implementations) are not added to the Object global.

Source:

Methods

(static) assign(_target, _firstSource) → {object}

The Object.assign() method only copies enumerable and own properties from a source object to a target object. It uses [[Get]] on the source and [[Put]] on the target, so it will invoke getters and setters. Therefore it assigns properties versus just copying or defining new properties. This may make it unsuitable for merging new properties into a prototype if the merge sources contain getters. For copying property definitions, including their enumerability, into prototypes Object.getOwnPropertyDescriptor() and Object.defineProperty() should be used instead.

Parameters:
Name Type Description
_target object

The target to assign to.

_firstSource object

The first source object to copy from.

Source:
Returns:

the _target, with properties assigned.

Type
object

(static) create(_proto, _properties) → {object}

Create an instance of an object that has another object as its prototype

Parameters:
Name Type Description
_proto object

The prototype of the newly created object, or null.

_properties object
Source:
Returns:

A new object that has the input object as prototype.

Type
object

(static) entries(_target) → {Array}

The Object.entries() method returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).

Parameters:
Name Type Description
_target object

The object to enumerate.

Source:
Returns:

The array of values

Type
Array

(static) is(_v1, _v2) → {boolean}

Object.is() determines whether two values are the same value. Two values are the same if one of the following holds:

  • both undefined
  • both null
  • both true or both false
  • both strings of the same length with the same characters
  • both the same object
  • both numbers and
  • both +0
  • both -0
  • both NaN
  • or both non-zero and both not NaN and both have the same value
Parameters:
Name Type Description
_v1

The first value to compare.

_v2

The second value to compare.

Source:
Returns:

A new object that has the input object as prototype.

Type
boolean

(static) keys(_obj) → {Array}

Return the property names defined directly on object

Parameters:
Name Type Description
_obj object

The target object.

Source:
Returns:

String[] property names.

Type
Array

(static) values(_target) → {Array}

The Object.values() method returns an array of a given object's own enumerable property values, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).

Parameters:
Name Type Description
_target object

The object to enumerate.

Source:
Returns:

The array of values

Type
Array