โ Back to Loops
Question 32
map: Convert Words to Uppercase
map: Convert Words to Uppercase
Use map to convert each word in the array to uppercase, then print them as comma-separated values.
Array:
['cat', 'dog', 'bird']
Expected output:
CAT,DOG,BIRD
Steps:
1. Use map on the words array
2. Convert each word using toUpperCase()
3. Print the new array with join(',')Expected Output:
CAT,DOG,BIRD
Topics:
LoopsArraysmap
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.