pulusatapathy

arrow func

Oct 23rd, 2020
665
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))
RAW Paste Data