Lodash教程

Lodash toString method

语法

_.toString(value)
Converts value to a string. An empty string is returned for null and undefined values. The sign of-0 is preserved.

参数

value (*) − The value to convert.

输出

(string) − Returns the converted string.

实例

var _ = require('lodash');
 
console.log(_.toString(-0));
console.log(_.toString([1, 2, 3]));
Save the above program in tester.js. Run the following command to execute this program.

Command

\>node tester.js

输出

-0
1,2,3
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4