Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thank you!
What the map is doing in this example is taking the current element (x), the index of the current element (i), and the array that .map was called upon (arr) - the x, i, and arr are just variables that you can name whatever you wish but they will always reprsent the element, index, array in that order. Sometimes you only want the array when using a map, but the only way to do that is to include the element and index regardless.
However if you only need the element you can write something as simply as .map((x) => x ** num), ignoring the index and array.
You can read more about it on the MDN here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
It should be stated in description.
maximize large items. the goal is to use the least amount of items.
This is great, please keep making these!
Great! The 'i' is not used in this case and it runs fine without it. Should it still be included for best practice? What would the 'i' represent if it was used? I am new to the .map method..