In the .map() training, there is an exercise that asks to iterate through the array and divide each number in the array by 100.
Can someone explain why the formatting of the code changes the way the results are displayed in the console? Is there even an important difference between the two, other than saving one of the results to a variable?
const bigNumbers = [100, 200, 300, 400, 500];
** this way logs the numbers in an array horizontally:
const smallNumbers = bigNumbers.map(element => {
return element / 100
})
console.log(smallNumbers)
** this way logs the numbers without an array and vertically:
const smallNumbers = bigNumbers.map(element => {
console.log(element / 100)})