_.isArrayLikeObject(value)
value _.
2023-09-11 14:15:01 时间
130
_.isArrayLikeObject(value)
_.isArrayLikeObject判断一个值是不是一个array-like对象,同时是objec-like和array-like对象
isObjectLike判断一个值是否是一个object-like,规则是:typeof返回object,并且不是null
isArrayLike判断一个值是否是一个array-like,规则:不等于null,不是function类型,并且有length属性,length是大于0小于Number.MAX_SAFE_INTEGER的整数
参数
value (*): 需要检查的值
返回值
(boolean): 如果是array-like对象且是object-like对象返回true,否则false
例子
_.isArrayLikeObject([1, 2, 3]); // => true _.isArrayLikeObject(document.body.children); // => true _.isArrayLikeObject('abc'); // => false _.isArrayLikeObject(_.noop); // => false
源代码
import isArrayLike from './isArrayLike.js' import isObjectLike from './isObjectLike.js' /** * This method is like `isArrayLike` except that it also checks if `value` * is an object. * * @since 4.0.0 * @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(Function) * // => false */ //判断一个值是不是一个array-like对象 //isObjectLike判断一个值是否是一个object-like,规则是:typeof返回object,并且不是null //isArrayLike判断一个值是否是一个array-like,规则:不等于null,不是function类型,并且有length属性,length是大于0小于Number.MAX_SAFE_INTEGER的整数 function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value) } export default isArrayLikeObject
相关文章
- Finding null value in Dataset - DataRow.IsNull method vs ==DbNull.Value - c#
- _.toNumber(value)
- _.lte(value, other)
- _.isSymbol(value)
- _.isObjectLike(value)
- _.isObject(value)
- _.isNumber(value)
- _.isNative(value)
- _.isNaN(value)
- _.isEqualWith(value, other, [customizer])
- _.isEmpty(value)
- _.cloneDeep(value)
- _.castArray(value)
- _.includes(collection, value, [fromIndex=0])
- 48Vue - 绑定 value(单选按钮、选择列表设置)
- Springboot学习之 使用@Value()注解给类静态属性赋值
- Java 让Map value自增
- Attribute value must be constant解决方法
- picker-view 组件 的value失效问题
- emoji错误:ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value:
- Csharp: Treeview check list value
- 转 关于nvcc fatal : Value 'sm_20' is not defined for option 'gpu-architecture'的问题
- Vue3实践指南:Prettier代码格式化工具、格式化Vue出现单引号变双引号及分号问题、useRouter执行后undefined问题、Property 'value' does not exist on type 'HTMLElement'、error Unexpected mutation of “xxxx“ prop
- 【bug修复】you must feed a value for placeholder tensor ‘Placeholder‘ with dtype float解决方案