Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const names = ['Sylwia', 'Kyle'];
- names.forEach((name, index) => console.log(index))
- // Since what we really need is the second variable, we can omit the first one with _.
- names.forEach((_, index) => console.log(index))
RAW Paste Data