-
Notifications
You must be signed in to change notification settings - Fork 0
collection.Function.each
soetas edited this page Nov 30, 2024
·
2 revisions
estdlib v0.1.2 / collection / each
each<
T
>(collection
,iteratee
?):void
Iterates over elements of collection and invokes iteratee for each element
• T
• collection: object
| T
[]
The collection to iterate over
• iteratee?: Function
The function invoked per iteration
void
0.1.2
each([1, 2], val=>console.log(val))
// => Logs `1` then `2`
each({a:1, b:2}, (val, key)=>console.log(key))
// => Logs 'a' then 'b' (iteration order is not guaranteed)
Docs made with by typedoc、typedoc-plugin-markdown & typedoc-github-wiki-theme.