Ad
  • Custom User Avatar

    If you aren't actually going to use the return value of .map() (which is a new array), then consider using .forEach() instead. Otherwise you are having JS create a new array but then never using it, whereas forEach iterates over each element but does not create a new array as a return value.

  • Custom User Avatar

    If you aren't actually going to use the return value of .map() (which is a new array), then consider using .forEach() instead. Otherwise you are having JS create a new array but then never using it, whereas forEach iterates over each element but does not create a new array as a return value.