Below is the work I have done (below create below):
let animals = ['Hen', 'elephant', 'llama', 'leopard', 'ostrich', 'Whale', 'octopus', 'rabbit', 'lion', 'dog'];
// Create the secretMessage array below
let SecretMessage = I dont know what goes here
I’ve seen .filter being used and word[0] and .join but a basic example of how to use word[0] with a .map statement would be great.
Here is an example of a .map function if you forgot:
let numbers = [1, 2, 3, 4, 5];
let bigNumbers = numbers.map(function(number) {
return number * 10;
});
Hopefully I’ve provided enough context and plenty of examples. Remember I’m specifically asking: how do I find the first letter of multiple strings with different letters in a .map statement using word[0]?
let numbers = [1, 2, 3, 4, 5];
let bigNumbers = numbers.map(function(number) {
return number * 10;
});
map is looping over each element in array, in each iteration of the loop, the element of the list is stored in number, then we can manipulate number, which is then added to the newly constructed array.
You are free to choice parameter name, but pick something logic and descriptive. Maybe the lesson even has a suggestion for a parameter name? Such a small question, given how long you have been programming, you should know this?
I have been working on this problem this evening for 3 hours. Earlier I was at a bootcamp also doing problem solving, so I have a better idea of how to debug a little bit more. I dont understand how to use the parameter in the function body itself.