Advertisement
pulusatapathy

arrow func

Oct 23rd, 2020
1,785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const names = ['Sylwia', 'Kyle'];
  2.  
  3. names.forEach((name, index) => console.log(index))
  4. // Since what we really need is the second variable, we can omit the first one with _.
  5. names.forEach((_, index) => console.log(index))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement