ES6-compliant shim for ToString.
npm install to-string-x href="https://travis-ci.org/Xotic750/to-string-x"
title="Travis status"> src="https://travis-ci.org/Xotic750/to-string-x.svg?branch=master"
alt="Travis status" height="18">
href="https://david-dm.org/Xotic750/to-string-x"
title="Dependency status"> alt="Dependency status" height="18"/>
href="https://david-dm.org/Xotic750/to-string-x?type=dev"
title="devDependency status"> alt="devDependency status" height="18"/>
href="https://badge.fury.io/js/to-string-x"
title="npm version"> alt="npm version" height="18">
href="https://www.jsdelivr.com/package/npm/to-string-x"
title="jsDelivr hits"> alt="jsDelivr hits" height="18">
href="https://bettercodehub.com/results/Xotic750/to-string-x"
title="bettercodehub score"> alt="bettercodehub score" height="18">
href="https://coveralls.io/github/Xotic750/to-string-x?branch=master"
title="Coverage Status"> alt="Coverage Status" height="18">
ES6-compliant shim for ToString.
See: 7.1.12 ToString ( argument )
The abstract operation ToString converts argument to a value of type String.
Kind: Exported function
Returns: string - The converted value.
Throws:
- TypeError If value is a Symbol.
| Param | Type | Description |
| ----- | --------------- | --------------------------------- |
| value | \* | The value to convert to a string. |
Example
``js
import $toString from 'to-string-x';
console.log($toString()); // 'undefined'
console.log($toString(null)); // 'null'
console.log($toString('abc')); // 'abc'
console.log($toString(true)); // 'true'
console.log($toString(Symbol('foo'))); // TypeError
console.log($toString(Symbol.iterator)); // TypeError
console.log($toString(Object(Symbol.iterator))); // TypeError
console.log($toString(Object.create(null))); // TypeError
``