A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/quizzes/javascript-arrays-1/ below:

Quiz about JavaScript Arrays

How do you loop through an array in JavaScript?
 

Which of the following statements creates a new empty array?

How do you access an element in an array?

Which of the following array methods can be used to add one or more elements to the end of an array?

What is the output of the following code snippet?

JavaScript
let arr1 = [1, 2, 3];
let arr2 = arr1;
arr2.push(4);
console.log(arr1);

Which of the following array methods can be used to remove the last element from an array?

Which of the following array methods can be used to remove one or more elements from an array and replace them with new elements?

What is the output of the following code snippet?

let arr1 = [1, 2, 3];
let arr2 = [4, 5, 6];
let arr3 = arr1.concat(arr2);
console.log(arr3);

What is the output of the following code snippet?
const arr = ["apple", "banana", "orange"];
const newArr = arr.slice(1, 2);

console.log(newArr);

What is the difference between slice() and splice() array methods?

There are 10 questions to complete.

Take a part in the ongoing discussion


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4