I rewatched that portion of the tutorial and you are correct. That is a mistake. I used the wrong variable. It looks like forEach will function on a nodeList, which I was not aware of, but I believe other Array methods will not. Sorry about the confusion.
Curious about first couple of lines in your JS file. They are: let lis = document.querySelectorAll('li'); let lis_array = Array.from(lis); You never use the variable lis_array anywhere in your code after that, so why did you define it? I"m working on something now using the data- attribute. I left that second variable out of my code, and it works just fine. BTW, I love your vids. I'm also taking one of your courses on Udemy.
Great question. I think I just forgot to use it. Basically that line is converting the list of elements to an array. This would be very helpful if you needed to use array methods, so it is a common practice for me. However, many things work on the array-like collection like forEach, so it was unnecessary.
Thank you sir. So helpful. I must be doing something wrong. Can't get my own code to work. Could I share it with you? Maybe, you'd spot my mistakes. Please.
@@AllThingsJavaScript Ah! Bless you sir. I've got sorted now. Thrilling to see it working. Thank you so much for offering to help sir. I hope I can reach out to you if I run into any more brick walls?
I have a number of tutorials on both objects and arrays. I have a specific playlist on objects and there are numerous other tutorials on both objects and array.
You used the forEach() method on the node list (lis) not the array (lis_array) but your event listeners still worked...?? Update: still works on the node list lol
The other day I heard from a c++ coder that web coders are not programmers, or not even developers! Because he asserted web doesn't have logic and algorithms have nothing to do with web! I don't know under which rock he was all these years or in which cave he was been hiding! Anyway, I hope he sees this channel, and comes out of his grave delusion. And choose a photo for channel icon or whatever it is for god sake! It looks darn bad like this!
I think most people have been corrected of that misperception, but I guess there are still some out there. Google keeps wiping my channel photo. It is a bit frustrating. Not sure what is going on.
@@AllThingsJavaScript Thanks for answering me. The removal of your channel photo might be due to copy right infringement. Just put some original photo which you've made it yourself. For example your beautiful face! You have a beautiful voice and because you're contributing to humanity a great deal your soul must be beautiful too. So I'm sure your face is beautiful! Then putting your own face for the icon of your channel is a good option bro!
Thanks for the suggestion. I don't know how beautiful my face is, but that was the picture I've had up and have tried to load multiple times again. I'm not sure what is going on, but still trying to figure it out.
@@AllThingsJavaScript So maybe you're too good looking that it raises powerful people jealousy, so they remove your picture! Like snow white and seven dwarfs and that darn magic mirror and that nasty queen who couldn't bear someone more beautiful than her!😂 Take care of yourself bro!
Great explanation, thank you sir :)
I finally understand thanks to you thank you🙌
Glad I could help!
Sir you are great . But had a doubt , U converted Node list into array but you didnt use forEach on the new array still it worked ??
I rewatched that portion of the tutorial and you are correct. That is a mistake. I used the wrong variable. It looks like forEach will function on a nodeList, which I was not aware of, but I believe other Array methods will not. Sorry about the confusion.
Nodelist,HTML collection and normal array etc are iterable using any loop may it be for, while or the forEach method
Brilliant, thank you! This is going to make web animation a lot easier
Glad it helped!
Clear explanation!
Curious about first couple of lines in your JS file. They are:
let lis = document.querySelectorAll('li');
let lis_array = Array.from(lis);
You never use the variable lis_array anywhere in your code after that, so why did you define it? I"m working on something now using the data- attribute. I left that second variable out of my code, and it works just fine.
BTW, I love your vids. I'm also taking one of your courses on Udemy.
Great question. I think I just forgot to use it. Basically that line is converting the list of elements to an array. This would be very helpful if you needed to use array methods, so it is a common practice for me. However, many things work on the array-like collection like forEach, so it was unnecessary.
Always very helpful. Many thanks.
Great tutorial! The forEach() should use lis_array instead of lis. Array.prototype.forEach() can only apply to arrays, not array-like objects.
You are correct. I converted to an array and then used the wrong variable.
awesome lecture.
Thank you very much.
thank you!
Thank you sir. So helpful. I must be doing something wrong. Can't get my own code to work. Could I share it with you? Maybe, you'd spot my mistakes. Please.
Sure, post it here.
@@AllThingsJavaScript
Ah! Bless you sir. I've got sorted now. Thrilling to see it working.
Thank you so much for offering to help sir. I hope I can reach out to you if I run into any more brick walls?
Could you pls make video for call bind apply methods?
Thank you sir
Can u please make some video related with javascript datastructure?
Can you explain what you are referring to for javascript datastructure videos?
data structures like queues an stacks, etc using objects and arrays?
I have a number of tutorials on both objects and arrays. I have a specific playlist on objects and there are numerous other tutorials on both objects and array.
means topic relater with linked list stack queue?
@@jainshilpi3 could you please share me the links if you have found some useful videos related to javascript datastructure?
You used the forEach() method on the node list (lis) not the array (lis_array) but your event listeners still worked...?? Update: still works on the node list lol
forEach will work on any iterator. A node list is one, so that is why it still worked.
For NodeList , forEach works, but for HtmlCollection doesnt
Super!!
Thanks!
Thanks
Still good video this 2024
a bit faster, though, would be greeeeaaaat. cheers.
change the playback speed.
The other day I heard from a c++ coder that web coders are not programmers, or not even developers! Because he asserted web doesn't have logic and algorithms have nothing to do with web! I don't know under which rock he was all these years or in which cave he was been hiding! Anyway, I hope he sees this channel, and comes out of his grave delusion. And choose a photo for channel icon or whatever it is for god sake! It looks darn bad like this!
I think most people have been corrected of that misperception, but I guess there are still some out there. Google keeps wiping my channel photo. It is a bit frustrating. Not sure what is going on.
@@AllThingsJavaScript Thanks for answering me. The removal of your channel photo might be due to copy right infringement. Just put some original photo which you've made it yourself. For example your beautiful face! You have a beautiful voice and because you're contributing to humanity a great deal your soul must be beautiful too. So I'm sure your face is beautiful! Then putting your own face for the icon of your channel is a good option bro!
Thanks for the suggestion. I don't know how beautiful my face is, but that was the picture I've had up and have tried to load multiple times again. I'm not sure what is going on, but still trying to figure it out.
@@AllThingsJavaScript So maybe you're too good looking that it raises powerful people jealousy, so they remove your picture! Like snow white and seven dwarfs and that darn magic mirror and that nasty queen who couldn't bear someone more beautiful than her!😂 Take care of yourself bro!