FAQ: Iterators - The .map() Method

#21

yes, its just a a shorthand.

#23

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.

#24

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.

#25

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

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

console.log(smallNumber)

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

#26

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:

#27

doh.

Thank you very much!