to-object-x
ES6-compliant shim for ToObject.
See: 7.1.13 ToObject ( argument )
module.exports(value)
⇒ Object
⏏
The abstract operation ToObject converts argument to a value of type Object.
Kind: Exported function
Returns: Object
- The value
converted to an object.
Throws:
TypeError
Ifvalue
is anull
orundefined
.
Param | Type | Description |
---|---|---|
value | * |
The value to convert. |
Example
; ; // TypeError; // TypeErrorconsole; // Object('abc')console; // Object(true)console; // Object(Symbol('foo'))