Make your website interactive with JavaScript
Difficulty: Beginner ● Progress: 0 / 0 modules completed
Arrays
So far, we have studied variables containing "primitive" types, meaning variables that contain one and only one piece of information: A number, a text, a boolean, etc...
Let's imagine a very simple exercise: we want to store the name of all the players of a game in order to display them afterwards. We can do it like this:
let player1 = "Mickael";
let player2 = "Marie";
let player3 = "Mohammed";
let player4 = "Miho";
console.log(player1, player2, player3, player4);
You need a free account to read this module