Man you are a godsend! Super informative and fun, i love how you'll acknowledge things that are a little hard to get used to or don't make that much sense because someone like me, i will only fully understand something if i know WHY it is that way. I can't just put random info in my brain. Having someone like you say "yea this is kinda weird but we'll have to get used to it" is really reassuring and helps me memorize things so much. I got a school assignment which i have to learn JS for and to be honest, i'd rather be doing anything else. But somehow through your videos, i think i'm actually looking forward to it now! Thanks!
5:24 ! The more efficient way :- This is our array => const arr = [ 1, 2, 3 ]; You know you gotta count them from 0 that means 0 corresponds to 1! The first element(1). If you wanna select 1 then you just can input the value i.e element.at(); The whole thing is gonna look like: // Input const arr = [1, 2, 3].at(0); console.log(arr); // Output = 1
I have never seen you answering questions, but will you or anyone tell me how to add elements not the beginning or the end by push and unshift , to the middle for example??
Ted, array starts at zero because the memory location of the whole array is the same of it's first element when the first element is zero. If it would start with one, the memory location for one is different than the array as a whole.
This is _not quite as applicable to Javascript_ because it is not a strictly typed language, but it serves to highlight _why_ arrays are indexed from [0] and why it is an (mostly) accepted standard. You may or may not know this, but for education purposes: Array index and [0] : An array (at least in classic programming terms) is allocated in contiguous (one-segment) of memory for whatever you may be storing in that array. So if you have an Array of numbers, the memory for that array will be allocated as: * A 'number' type takes up a certain amount of memory, lets pretend it takes up 32 bits per value (or as an Int32 for someone who may be familiar). Let's say you declare an array as follows: var myArray = [5, 7, 29, 43, 12]; The memory allocated for this array will be * = Now the variable "myArray" classically doesn't actually store the _entire_ array - it is what would be referred to as a *pointer* to the start of the allocated memory for that array. When you ask for an element inside the array (let's say you want the second number) you specify the _offset_ from the beginning of the memory block. An offset of _0_ would give you the first element, and offset of _1_ would give you the second, and so forth. This is calculated when you specify the index as _myArray[1]_ as follows: + ( * ) = In the case of our example it would be + ( * ) = so in our example: myArray[1] = 7 I hope this helps someone who was wondering why [0] is the index. Now this example gets a little wonky once you start realizing that it only applies to strictly typed languages that allocates memory for _types_ and doesn't treat everything in the language as an underlying type of _object_ like many modern programming languages do, but know that behind the scenes, the C/C++/whatever the code base is, is probably doing this; what you're seeing is a representation of this functionality extended into a syntactical standard. Also, you may be thinking "but strings aren't the same size" : this is because string arrays are allocated as two-dimensional arrays of characters.
Why indexes starts from 0? I think it is because they answer the question: on which item am I looking at after the 1st one? (and not: at which item in the order I am looking at [at the moment]). It is just more hardware point of view instread of human one. What I read on Internet is also that the calculations on indexes are easier this way.
This man is like a coding Bob Ross, just saved me from a mental breakdown
Back home! A few more videos and we will wrap up this series and go back to doing some practical projects!
yep!
list = ["Videos!", "Love ", "Your ", "I "]
console.log(list[3] + list[1] + list[2] + list[0])
+1
@SOK PAGNAVATH i dont think thats the point of the comment
you forgot semicolon;
@SOK PAGNAVATH thats not the point vro
I don't why i love Dev Ed
His HTML and CSS made me develop fast. Now am on JavaScript😊
You're so kind bro, your teaching style is awesome! I dont really leave comments or sub to anyone but you're the best! Best of luck!
So right
Your energy is always amazing.
Man you are a godsend! Super informative and fun, i love how you'll acknowledge things that are a little hard to get used to or don't make that much sense because someone like me, i will only fully understand something if i know WHY it is that way. I can't just put random info in my brain. Having someone like you say "yea this is kinda weird but we'll have to get used to it" is really reassuring and helps me memorize things so much.
I got a school assignment which i have to learn JS for and to be honest, i'd rather be doing anything else. But somehow through your videos, i think i'm actually looking forward to it now! Thanks!
5:24 ! The more efficient way :-
This is our array => const arr = [ 1, 2, 3 ];
You know you gotta count them from 0 that means 0 corresponds to 1! The first element(1).
If you wanna select 1 then you just can input the value i.e element.at();
The whole thing is gonna look like:
// Input
const arr = [1, 2, 3].at(0);
console.log(arr);
// Output = 1
it's easy and funny to learn with you!
Great teacher!!
very good
I appreciate how you explain the concepts and define what each element means
I have never seen you answering questions, but will you or anyone tell me how to add elements not the beginning or the end by push and unshift , to the middle for example??
I think this is the best array explanation I have got in my whole live
Ted, array starts at zero because the memory location of the whole array is the same of it's first element when the first element is zero. If it would start with one, the memory location for one is different than the array as a whole.
Brother this is very helpful, I just want you to know your efforts are not wasted, RESPECT.
what theme are you using in here? btw, i love your videos!!! thank you!
the smile alone, made me understood it😊, nice job
I like your vibe
Hey Edwin I will like to correct your pronounciation of the word "schedule" it is pronounced as"sha + dule" thank you
I love the way you teach, you always smiling!
These series are so good. Great explanations!
Thank you Ed, for your wonderful tutorial. I have a query: How to remove the elements which are in the middle of the array?
you can use splice() method
I really love watching your videos they have been so helpful to me so far since I found you. Thank you so much
Your videos are so helpful!!!!
I just enjoy the way this guy teaches. He is must subscride.
LOVE HOW YOU EXPLAIN THIS STUFF !! thanks alot !
This is _not quite as applicable to Javascript_ because it is not a strictly typed language, but it serves to highlight _why_ arrays are indexed from [0] and why it is an (mostly) accepted standard.
You may or may not know this, but for education purposes:
Array index and [0] :
An array (at least in classic programming terms) is allocated in contiguous (one-segment) of memory for whatever you may be storing in that array.
So if you have an Array of numbers, the memory for that array will be allocated as:
*
A 'number' type takes up a certain amount of memory, lets pretend it takes up 32 bits per value (or as an Int32 for someone who may be familiar).
Let's say you declare an array as follows:
var myArray = [5, 7, 29, 43, 12];
The memory allocated for this array will be
* =
Now the variable "myArray" classically doesn't actually store the _entire_ array - it is what would be referred to as a *pointer* to the start of the allocated memory for that array.
When you ask for an element inside the array (let's say you want the second number) you specify the _offset_ from the beginning of the memory block. An offset of _0_ would give you the first element, and offset of _1_ would give you the second, and so forth.
This is calculated when you specify the index as _myArray[1]_ as follows:
+ ( * ) =
In the case of our example it would be
+ ( * ) =
so in our example: myArray[1] = 7
I hope this helps someone who was wondering why [0] is the index.
Now this example gets a little wonky once you start realizing that it only applies to strictly typed languages that allocates memory for _types_ and doesn't treat everything in the language as an underlying type of _object_ like many modern programming languages do, but know that behind the scenes, the C/C++/whatever the code base is, is probably doing this; what you're seeing is a representation of this functionality extended into a syntactical standard.
Also, you may be thinking "but strings aren't the same size" : this is because string arrays are allocated as two-dimensional arrays of characters.
Hi Ed. Thank you so much for your tutorials. Your videos really are well explained and easy to understand... Have a nice day!!!
Thanks for such such a masterpiece video.
Thanks man. Love your vibe.
Why indexes starts from 0? I think it is because they answer the question: on which item am I looking at after the 1st one? (and not: at which item in the order I am looking at [at the moment]). It is just more hardware point of view instread of human one. What I read on Internet is also that the calculations on indexes are easier this way.
How can I pass an array to a function, as a SINGLE argument, and then access the elements of that array from within the function?
You r a great teacher..
this was perfect and well explained. thank you!
When I think of you moving to your home country, I think of Fez from that 70's show because we never learn his home country.
You’re awesome thank you
love ur videos
Great teacher!! thank you
can you add two same things to an array?
love ur vidoes
dev ed
Wait, the arrey is supposed to be constent, how is it possible to change it's values? Or it ain't including arreys
hey wait in minute! We create constant value but we can change it. How did happen? I am confused.
what is the song at the beginning of the video? btw, love your vids.
Lol, you are funny. I am enjoying my classes.😁
Vanakam da mapla Tamilnadu la irudhu ♥️
that's great I got the points here
love how he makes learning his tutorial humurous😂
Thx 🙏
So variables can't have spaces unless they are arrays??
If you are allowed to modify array, then why use const keyword?
I did not understand that either but this link www.w3schools.com/js/js_const.asp explains what const does.
you have to watch video on variable and understand things (var , let , counts);
What is this intro song called?
helpful
Dumb question #1
I know you can add things to the array using .push, but why not go back to the original array and just add it there?
heloo do you have jquery course
It's very similar to python. Isn't it?
Like just for that intro
What, no intro-tricks? Dissapointed...:D
from NGR
I’m sure that you dont have legs
more learn before teach
Too much emotions, just get to the points ffs