Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Défi : Modification des Tableaux | Tableaux
Introduction à TypeScript
course content

Contenu du cours

Introduction à TypeScript

Introduction à TypeScript

1. Fondamentaux de TypeScript
2. Instructions Conditionnelles
3. Tableaux
4. Boucles
5. Fonctions

book
Défi : Modification des Tableaux

Tâche

Vous avez deux tableaux. Votre tâche est de supprimer les premiers et derniers éléments de chacun des tableaux, puis d'afficher le tableau combiné à l'écran. Utilisez les méthodes que nous avons apprises dans cette section. Si vous avez des difficultés à comprendre la tâche, vous pouvez utiliser les boutons Indice et Solution pour voir et analyser la solution.
De cette façon, vous comprendrez mieux l'information.

12345678
let firstArray: (number | string)[] = [0, 1, 2, 3, 4, 5]; let secondArray: (number | string)[] = ['zero', 'one', 'two', 'three', 'four', 'five'] firstArray.___(); //removing the last element secondArray.___(); //removing the last element firstArray.___(); //removing the first element secondArray.___(); //removing the first element let mixedArray: (___ | ___)[] = firstArray.___(___); //mixing two arrays into one console.log(mixedArray); // printing mixed array
copy

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 4
We're sorry to hear that something went wrong. What happened?
some-alt