JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
JS Fundamentals: Objects, Arrays, and Functions
Introduction
Content
Bonus: Merge Sort
More
Share
Explore
Objects & Arrays
Exercise: Implement logEach()
Tweet me that you did the exercise!
Prompt
Implement
logEach
that iterates over a collection &
console.log()
each item.
Definition:
logEach(collection)
Example Usage:
const
weapons = [
'Revolver'
,
'Knife'
,
'Lead Pipe'
,
'Candlestick'
];
logEach
(weapons);
// => "Revolver"
// => "Knife"
// => "Lead Pipe"
// => "Candlestick"
Code here
Loading…
Solution
The solution is in the solution branch, which can be checked out in the
Repl.it
by selecting the version control tab on the right and then selecting the solution branch from the drop down menu.
If you are having trouble with
repl.it,
the solutions are also available below.
logEach Solution
Next 👉
Bonus: Map and Set
©2021
Code and Coffee
for
Frontend Masters
Prompt
Code here
Solution
logEach Solution
Next 👉 Bonus: Map and Set
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.