Computer scienceProgramming languagesJavaScriptWorking with dataArrays

Array iterating

Callback

Report a typo

We have an array and a function. Call this function inside yourFunction() for each element of the given array.

Sample Input 1:

[ 'red', 'green', 'blue' ]

Sample Output 1:

RED
GREEN
BLUE
Write a program in JavaScript
function upCase(str) {
console.log(str.toUpperCase());
}
function yourFunction(arr) {
//write your code here
}
___

Create a free account to access the full topic