Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -const actions = [
- - writeLine("Jake Weary"),
- - writeLine("ScarJo"),
- - writeLine("Chris Hemsworth"),
- - writeLine("Mark Ruffalo")
- -]
- -
- + // Cycle these 4 names 100 times
- +const names = ["Jake Weary", "ScarJo", "Chris Hemsworth", "Mark Ruffalo"]
- +
- +const actions = Array
- + .from(Array(100).keys())
- + .map(i => writeLine(names[i % names.length]))
Add Comment
Please, Sign In to add comment