Skip to content

isArrayLikeObject

js
_.isArrayLikeObject(value)

此方法与 _.isArrayLike 类似,不同之处在于它还检查 value 是否为对象。

¥This method is like _.isArrayLike except that it also checks if value is an object.

新增于

¥Since

4.0.0

参数

¥Arguments

  1. value (*):要检查的值。

    ¥value ()*: The value to check.

返回

¥Returns

(布尔):如果 value 是类似数组的对象,则返回 true,否则返回 false

¥(boolean): Returns true if value is an array-like object, else false.

示例

¥Example

js
_.isArrayLikeObject([1, 2, 3]);
// => true

_.isArrayLikeObject(document.body.children);
// => true

_.isArrayLikeObject('abc');
// => false

_.isArrayLikeObject(_.noop);
// => false

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