... array js code example
Example 1: javascript array
var colors = ["red","blue","green"];
for (var i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
Example 2: javascript array
var food = ["cake", "apple", "Ice-Cream"]
var Number = [Math.floor(Math.random() * food.length)];
console.log(logammounts[woodloot])
Example 3: tableau js
let monTableau = ['un', 'deux','trois', 'quatre'] ;
console.log(monTableau[monTableau.length - 1]) ;
let monTableau2D = [
['Mark' , 'jeff' , 'Bill'] ,
['Zuckerberg' , 'Bezos' , 'Gates']
] ;
console.log (monTableau2D[1][2]) ;
let monTableauAssociatif = {
'prenom' : 'Mark' ,
'nom' : 'Zuckerberg' ,
'poste' : 'Pdg de Facebook',
} ;
console.log(monTableauAssociatif['poste']) ;