1//create an array like so:
2var colors = ["red","blue","green"];
3
4//you can loop through an array like this:
5for (var i = 0; i < colors.length; i++) {
6 console.log(colors[i]);
7}
1//create an array
2let numbers = [ 11 , 13 , 15 , 17]
3
4//you can use loop like this
5for(let i = 0;i<numbers.length;i++) {
6 console.log(numbers[i])
7}
1var events = [
2 {
3 userId: 1,
4 place: "Wormholes Allow Information to Escape Black Holes",
5 name: "Check out this recent discovery about workholes",
6 date: "2020-06-26T17:58:57.776Z",
7 id: 1
8 },
9 {
10 userId: 1,
11 place: "Wormholes Allow Information to Escape Black Holes",
12 name: "Check out this recent discovery about workholes",
13 date: "2020-06-26T17:58:57.776Z",
14 id: 2
15 },
16 {
17 userId: 1,
18 place: "Wormholes Allow Information to Escape Black Holes",
19 name: "Check out this recent discovery about workholes",
20 date: "2020-06-26T17:58:57.776Z",
21 id: 3
22 }
23];
24console.log(events[0].place);
1var colors = [ "red", "orange", "yellow", "green", "blue" ]; //Array
2
3console.log(colors); //Should give the whole array
4console.log(colors[0]); //should say "red"
5console.log(colors[1]); //should say "orange"
6console.log(colors[4]); //should say "blue"
7
8colors[4] = "dark blue" //changes "blue" value to "dark blue"
9console.log(colors[4]); //should say "dark blue"
10//I hope this helped :)