FAQ: Iterators - The .map() Method


yes, its just a a shorthand.


The return keyword isn’t used in the JavaScript file because for arrow function syntax, you can write your code block without the curly braces {}, parenthesis (), and the return keyword for concise (in essence, concise refers to ‘less terms’) function bodies, whilst in the instructions it may have been used with the {}, (), and return keyword making it less concise. Remember as a programmer, you want to do less work.


This is my second time through this course. First time was the free version. Now I am doing the Pro version. Regardless, once you get through it the first time (and try another JS related course like myself) and try it again a lot more will make sense from the Higher Order Functions lesson and onward. Likely what is stumping you is being familiar with the usage of pre and post ES6 style.


This solution prints the correct solution to the console for the second part:

const smallNumber= bigNumbers.map(random=>{
return random/100


however, the exercise will not pass. What am I missing? Is there a bug in this lesson?


These are the instructions:

Use .map() to divide all the numbers in bigNumbers by 100 . Save the returned values to a variable declared with const called smallNumbers .

It’s probably as simple as you having used smallNumber instead of smallNumbers. :wink:



Thank you very much!