[X]

arguments Is Not An Array

luljs still works

The arguments object looks like an array but has none of its methods.

In 2026: Still works in non-arrow functions. arguments holds the call's arguments and has a length and numeric indices, but its type is "object" and it has no map, filter or forEach. You convert it with Array.from(arguments) or a rest parameter. Arrow functions have no arguments at all.

Where it came from: arguments is an array-like object, not an array; MDN's arguments page lists what it lacks. MDN

<script>
(function () {
  document.write('<p><code>typeof arguments</code> is <b>"' + (typeof arguments) + '"</b></p>');
  document.write('<p><code>arguments.length</code> is <b>' + arguments.length + '</b></p>');
  document.write('<p><code>Array.isArray(arguments)</code> is <b>' + Array.isArray(arguments) + '</b></p>');
})(1, 2, 3);
</script>
sandboxed demo · breaks nothing but itselfrestart

More in luljs

all 63 in luljs › · the whole library ›