main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
578 bytes
|
Line | |
---|
1 | import baseToString from './_baseToString.js';
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Converts `value` to a string. An empty string is returned for `null`
|
---|
5 | * and `undefined` values. The sign of `-0` is preserved.
|
---|
6 | *
|
---|
7 | * @static
|
---|
8 | * @memberOf _
|
---|
9 | * @since 4.0.0
|
---|
10 | * @category Lang
|
---|
11 | * @param {*} value The value to convert.
|
---|
12 | * @returns {string} Returns the converted string.
|
---|
13 | * @example
|
---|
14 | *
|
---|
15 | * _.toString(null);
|
---|
16 | * // => ''
|
---|
17 | *
|
---|
18 | * _.toString(-0);
|
---|
19 | * // => '-0'
|
---|
20 | *
|
---|
21 | * _.toString([1, 2, 3]);
|
---|
22 | * // => '1,2,3'
|
---|
23 | */
|
---|
24 | function toString(value) {
|
---|
25 | return value == null ? '' : baseToString(value);
|
---|
26 | }
|
---|
27 |
|
---|
28 | export default toString;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.