const variableName = new Array("data1", data2, data3....);
With out Array
const age = 24;
const name = "Ahmed";
With Array
const details = new Array(24, "Ahmed");
const details = new Array("Ahmed", 24);
const details = [24,"Ahmed"];
Aqriste waxaa jiro methods tiro badan oo ku dhex jiro Arrays, waxeyna no suuro galiyaan inaan Array wax ku darno, wax ka reebno, sidokale waxey naga caawiyaan inaan ogaano waxa ku dhex jiro Array.
hadii aad rabto inaad wax ku darto Array waxa jiro method kaa caawinayo shaqadas.
console.log(details); // Before Ouput: [ 24, 'Ahmed']
details.push("Yare");
console.log(details); // After Ouput: [ 24, 'Ahmed', 'Yare' ]
method ka push() waxa uu oga darayaa details qeebta dambe ama meesha ogu dambeyso.
Sidokale wax ayaad ka jari kartaa Array.
details.push("Yare");
console.log(details); // Before Ouput: [ 24, 'ahmed', 'Yare' ]
details.pop();
console.log(details); // After Ouput: [ 24, 'ahmed']
method ka pop() waxa uu delete garenaya midka ogu dambeeyo.
Aqrinste waxaan rajeenaya inaad wax badan ka faaidey qormadaan.