打赏

lodash toString 转换为字符串

转换 value 为字符串。 null 和 undefined 将返回空字符串。-0 将被转换为字符串"-0"

_.toString(null);
// => ''
 
_.toString(-0);
// => '-0'
 
_.toString([1, 2, 3]);
// => '1,2,3'

优于js的toString和String()方法。

posted @ 2018-07-17 15:44  孟繁贵  阅读(3037)  评论(0编辑  收藏  举报
TOP