Skip to content

toArray

js
_.toArray(value)

value 转换为数组。

¥Converts value to an array.

新增于

¥Since

0.1.0

参数

¥Arguments

  1. value (*):要转换的值。

    ¥value ()*: The value to convert.

返回

¥Returns

(数组):返回转换后的数组。

¥(Array): Returns the converted array.

示例

¥Example

js
_.toArray({ 'a': 1, 'b': 2 });
// => [1, 2]

_.toArray('abc');
// => ['a', 'b', 'c']

_.toArray(1);
// => []

_.toArray(null);
// => []

Lodash v4.17 中文网 - 粤ICP备13048890号