MCQs>IT & Programming>JavaScript>What will be logged into the console? var animals = ['moose', 'giraffe', 'unicorn']; animals.forEach(function(animal, index) { if (index === 2) { console.log(animal); } });
JavaScript MCQs
In the following example, what will be logged into the console? var animals = ['moose', 'giraffe', 'unicorn']; animals.forEach(function(animal, index) { if (index === 2) { console.log(animal); } });
Answer
Correct Answer: unicorn
Explanation:
Note: This Question is unanswered, help us to find answer for this one