mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Bump to v4.0.0.
This commit is contained in:
32
isArrayLikeObject.js
Normal file
32
isArrayLikeObject.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import isArrayLike from './isArrayLike';
|
||||
import isObjectLike from './isObjectLike';
|
||||
|
||||
/**
|
||||
* This method is like `_.isArrayLike` except that it also checks if `value`
|
||||
* is an object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @type Function
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isArrayLikeObject([1, 2, 3]);
|
||||
* // => true
|
||||
*
|
||||
* _.isArrayLikeObject(document.body.children);
|
||||
* // => true
|
||||
*
|
||||
* _.isArrayLikeObject('abc');
|
||||
* // => false
|
||||
*
|
||||
* _.isArrayLikeObject(_.noop);
|
||||
* // => false
|
||||
*/
|
||||
function isArrayLikeObject(value) {
|
||||
return isObjectLike(value) && isArrayLike(value);
|
||||
}
|
||||
|
||||
export default isArrayLikeObject;
|
||||
Reference in New Issue
Block a user