Files
lodash/toString.js
John-David Dalton 6cb3460fce Remove semicolons.
2017-02-05 22:22:04 -08:00

27 lines
549 B
JavaScript

import baseToString from './.internal/baseToString.js'
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* toString(null)
* // => ''
*
* toString(-0)
* // => '-0'
*
* toString([1, 2, 3])
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value)
}
export default toString