Converts value to a string. An empty string is returned for null and undefined values. The sign of -0 is preserved.
value
null
undefined
-0
The value to convert.
Returns the converted string.
5.5.0
toString(null)// => ''toString(-0)// => '-0'toString([1, 2, 3])// => '1,2,3' Copy
toString(null)// => ''toString(-0)// => '-0'toString([1, 2, 3])// => '1,2,3'
Converts
value
to a string. An empty string is returned fornull
andundefined
values. The sign of-0
is preserved.