What's wrong with code?


#1

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

// Create the secretMessage array below
let secretMessage = animals.map(function(animal){
return animal.split(’’).charAt(0);

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

});


#2

The .split() method is not needed. .charAt(index) manages without intervention since a string is an iterable.


#3

@mtf, Thanks, now its working