Code snippets that use .map() should be used with .forEach() instead. . map() returns a new array - always - and if we don't need that array, we shouldn't use it in the first place. In this particular example there are only three items in the array so creating another three-element array won't bring any serious consequences.
11 Comments
Sort: