map: Double Each Number
easyQuestion 31Use map to create a new array where each number is doubled, then print the result as comma-separated values.
Array: [1, 2, 3, 4]
Steps:
1. Use map on the provided numbers array
2. Return each number multiplied by 2
3. Print the new array using join(',')
Expected output
2,4,6,8= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
LoopsArraysmap
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (clog, fn, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.