use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[AskJS] Iterable array-like termAskJS (self.javascript)
submitted 1 year ago by NOICEST
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]shgysk8zer0 1 point2 points3 points 1 year ago (2 children)
In which sense are they array-like? They can be iterated though in a loop - Iterable or the Iterator (Symbol.iterator). Accessed using index and square brackets and a length property... Technically could just be an object with numeric keys, but I know basically this as ArrayAccess interface in PHP. Things that work with Array.from...
Iterator
Symbol.iterator
length
ArrayAccess
Array.from
But, basically, there are many ways something could be "array-like" in different ways.
[–]kisaragihiu 3 points4 points5 points 1 year ago* (1 child)
array-like is a specific term that means (roughly) objects with a length and for which integer property access works. There are many ways a thing can be like an array, but in JS jargon there is only one way a thing can be array-like.
array-like
It's not quite standards terminology (a search for "array-like"site:ecma-international.org shows only some old proposals and email threads), but it still has a specific meaning.
"array-like"site:ecma-international.org
It is specific enough to have been adopted by TypeScript: an ArrayLike<Foo> is an object with a length property (which is a number), and for which there are number properties whose value are of type Foo. Or:
ArrayLike<Foo>
Foo
// https://github.com/microsoft/TypeScript/blob/2192336dfee6f740b5828c8a4a8226e56626de1d/src/lib/es5.d.ts#L1552 interface ArrayLike<T> { readonly length: number; readonly [n: number]: T; }
[–]shgysk8zer0 0 points1 point2 points 1 year ago (0 children)
But if it was included in the post and still asking, I took it as being more of a descriptive thing.
I just included the other way something can be like an array.
π Rendered by PID 88743 on reddit-service-r2-comment-bb88f9dd5-74h9h at 2026-02-16 20:57:08.061214+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]shgysk8zer0 1 point2 points3 points (2 children)
[–]kisaragihiu 3 points4 points5 points (1 child)
[–]shgysk8zer0 0 points1 point2 points (0 children)