What will be the output of the following code?
const colors = ['Red', 'Green', 'Blue'];
let result = '';
colors.forEach((color, index) => result += `${index}: ${color} `);
console.log(result.trim());
What will be the output of the following code?
const colors = ['Red', 'Green', 'Blue'];
let result = '';
colors.forEach((color, index) => result += `${index}: ${color} `);
console.log(result.trim());