Learn JavaScript ARRAYS in 8 minutes! 🗃

preview_player
Показать описание
00:00:00 arrays
00:01:06 index
00:02:16 array methods
00:03:07 .length
00:03:41 .indexOf
00:04:33 iterate an array
00:06:34 enhanced for loop
00:07:18 sort
00:07:29 reverse sort
00:07:44 conclusion

// array = a variable like structure that can
// hold more than 1 value

let fruits = ["apple", "orange", "banana", "coconut"];

for(let fruit of fruits){
}
Рекомендации по теме
Комментарии
Автор

// array = a variable like structure that can
// hold more than 1 value

let fruits = ["apple", "orange", "banana", "coconut"];

//fruits.push("coconut"); //add an element
//fruits.pop(); //removes last element
//fruits.unshift("mango"); //add element to beginning
//fruits.shift(); //removes element from beginning

let numOfFruits = fruits.length;
let index = fruits.indexOf("coconut");

//console.log(fruits);
//console.log(fruits[0]);
//console.log(fruits[1]);
//console.log(fruits[2]);
//console.log(fruits[3]);

//console.log(numOfFruits);
//console.log(index);

/*
for(let i = 0; i < fruits.length; i++){
console.log(fruits[i]);
}
*/
/*
for(let i = fruits.length - 1; i >= 0; i--){
console.log(fruits[i]);
}
*/

//fruits.sort();
//fruits.sort().reverse();

for(let fruit of fruits){
console.log(fruit);
}

BroCodez
Автор

Wow, what a fantastic tutorial! Learning JavaScript arrays in just 8 minutes is incredibly impressive. The way you explained the concepts and demonstrated practical examples made it so easy to grasp the fundamentals. Thank you for breaking down a potentially complex topic into such a digestible and accessible format. Your clear explanations and engaging teaching style kept me hooked throughout the entire video. I appreciate your effort in making learning JavaScript arrays so enjoyable and effortless. Looking forward to more of your tutorials! 👏👍

RehanPathan-
Автор

I wwatched 4 tutorials and this was the first one to actually explain to my what is going on- rather than just writing the code

ewjefnkwjfn
Автор

<*_> This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal. <_*>

piotrmazgaj
Автор

the perfect explanation!! Thanks really grate.

samanthacastano
Автор

I just spend 20 mins trying to figure out what is the use of it and the guy just explained it in the first 20 seconds

kcode.codeandtech
Автор

Thanks bro. I'll wait for some more complex tutorials. Take your time :D

hunin
Автор

How would you apply the fruits variable into index.html? I understand linking it with <script src="index.js"></script> but can that variable be used as a preset dropdown menu? Wish I could figure out how to make a preset platform/layout/menu instead of repetitively making a long list of coding on each html page.

Maybe I'm looking at this the wrong way..

lostmotion