Topic

JavaScript Arrays

Practice related MCQ quizzes and improve step by step.

Quizzes in JavaScript Arrays

What will be output in console:

var animals = ['Tiger', 'Lion', 'Camel', 'Cow', 'Duck'];
console.log(animals.slice(2, 4));
Correct answer(s):
    • Array ["Camel", "Cow"]

What is going to display with this js code:

var myArray = ['a', 'b', 'c'];
 console.log(myArray[-1]);
Correct answer(s):
    • undefined