Https://www.codecademy.com/courses/introduction-to-javascript/lessons/javascript-iterators/exercises/map?action=resume_content_item

const animals = [‘Hen’, ‘elephant’, ‘llama’, ‘leopard’, ‘ostrich’, ‘Whale’, ‘octopus’, ‘rabbit’, ‘lion’, ‘dog’];

// Create the secretMessage array below
const secretMessage = animals.map(animal => animal[0]);

console.log(secretMessage.join(’’));

const bigNumbers = [100, 200, 300, 400, 500];

// Create the smallNumbers array below
const smallNumbers = bigNumbers.map(num => num/100);

console.log(smallNumbers)

I want to understand where did num come from?
https://www.codecademy.com/courses/introduction-to-javascript/lessons/javascript-iterators/exercises/map?action=resume_content_item

1 Like

Nice questions. The small numbers divides the big numbers from 100 makes 1, 2,3,4,5.

I hope this helps =)

const input = “I am a whale and i’m a shark too.”;
const vowels = [“a”,“e”,“i”,“o”,“u”];
let resultArray = ;
for (let inputIndex = 0; inputIndex < input.length; inputIndex++){

// console.log ("inputIndex = " + input[inputIndex]);

for (let vowel = 0; vowel < vowels.length; vowel++){
if (input[inputIndex] === vowels [vowel]){
if (input[inputIndex] === 'e '){
resultArray.push(‘ee’);
}
else if(input[inputIndex] === ‘u’){
resultArray.push(‘uu’);
}
else{
resultArray.push(input[inputIndex]);
}
}
}
}
console.log(resultArray.join ("").toUpperCase());