This commit is contained in:
szabomarton
2025-01-28 11:38:27 +01:00
parent 9c5ca86086
commit 7f4a15b9c3
36841 changed files with 4032468 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
'use strict';
var $TypeError = require('es-errors/type');
var Get = require('./Get');
var ToLength = require('./ToLength');
var isObject = require('../helpers/isObject');
// https://262.ecma-international.org/11.0/#sec-lengthofarraylike
module.exports = function LengthOfArrayLike(obj) {
if (!isObject(obj)) {
throw new $TypeError('Assertion failed: `obj` must be an Object');
}
return ToLength(Get(obj, 'length'));
};
// TODO: use this all over