Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Removing Elements from an Array | Exploring Arrays
Introduction to JavaScript
course content

Contenu du cours

Introduction to JavaScript

Introduction to JavaScript

1. Getting Started
3. Conditional Statements
4. Mastering Functions
5. Exploring Arrays
6. Discovering Loops

book
Removing Elements from an Array

There are two methods available for removing elements from an array: pop and shift.

The pop method removes an element from the end of the array:

123
let fruits = ["Apple", "Banana", "Cherry"]; fruits.pop(); console.log(fruits);
copy

The shift element removes an element from the start of the array:

123
let fruits = ["Apple", "Banana", "Cherry"]; fruits.shift(); console.log(fruits);
copy

1. What does the pop method do in JavaScript?

2. What will be the output of the following code?

question mark

What does the pop method do in JavaScript?

Select the correct answer

question mark

What will be the output of the following code?

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 5. Chapitre 6

Demandez à l'IA

expand
ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

course content

Contenu du cours

Introduction to JavaScript

Introduction to JavaScript

1. Getting Started
3. Conditional Statements
4. Mastering Functions
5. Exploring Arrays
6. Discovering Loops

book
Removing Elements from an Array

There are two methods available for removing elements from an array: pop and shift.

The pop method removes an element from the end of the array:

123
let fruits = ["Apple", "Banana", "Cherry"]; fruits.pop(); console.log(fruits);
copy

The shift element removes an element from the start of the array:

123
let fruits = ["Apple", "Banana", "Cherry"]; fruits.shift(); console.log(fruits);
copy

1. What does the pop method do in JavaScript?

2. What will be the output of the following code?

question mark

What does the pop method do in JavaScript?

Select the correct answer

question mark

What will be the output of the following code?

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 5. Chapitre 6
Nous sommes désolés de vous informer que quelque chose s'est mal passé. Qu'est-il arrivé ?
some-alt