i'm Vietnamese student and i was stuck when i try to study in the internet till i find your channel . I'm not good in English so I meet many struggle to learn the definition of some thing new. But with your explaining I can understand the content easily, coding being funny ,i really interesting with your style in teaching ,I never meet one like u in my country. I watch all of them. thanks bro!!!
1:10 it did not sort it in numerical order. Array.prototype.sort is not sorting numerically. it threats your numbers as strings, therefore an array [3, 21, 10] would be sorted to => [10, 21, 3]
Alright, for those confused like me, here's the explanation. Sort method changes them to '10, '21', '3' and then checks them. So, the number starting with 1 comes first, that starting with 2 comes next and so on. If you had [400, 3, 21, 100000], the output after sorting would be [10000, 21, 3, 400].
The way he explains is just something different, so noob friendly that it is impossible to not understand. I would recommend his lessons to everyone. Even if you know the topic, just refresh your knowledge to make things even more clear in your mind.
I just want to say, you're terrible at teaching those of us who need a quick answer for those of us on a deadline for a particular project for a client BUT you are absolutely fantastic at helping us understand these concepts on a deep level. I've watched a tutorial series on all of these ES6 topics before. I already use ES6 in my work but I've gone through your whole playlist and it feels I actually understand what I'm writing now (also when to use arrow notation, because prior to this series I've just been writing all my functions as arrow functions just because it was fashionable).
from India 18 learning web dev, Loved the way you teach, If you're our teacher we will be very peacefully and happily become the best developers cause we don't have any good teacher like you are. But, in the future, If I get chance to teach I will copy the way you teaches your amazing sir
honestly this is my first time seeing dude, and i am only 1:56 into this video but i get the feeling hes gonna be super helpful from now on. Thanks for all the effort you put into helping random folk online.
wondeful videos I am learning more from these videos than from most anythoing else I have tried. I like the way you intuitively merge the concepts with the coding and I also like that you make mistakes and explain them when you find them I plan to get through most in not all of your courses, thank you very much.
It sorts capitals before smalls because in ASCII formatting, numbers come first, capitals next, smalls last. Somewhere in there all punctuation also fits, you can see their ASCII value to know about that.
Eres muy bueno, y gracioso. Hace mas facil querer aprender. Muchas Gracias, desde Argentina.
3 года назад
Thank you So much , I dont know how many times you saved me or explained me subject !!!!!!!! You are the best my friend, İ'm learning web development , We have a small whatsap group, I like sharing your videos to share knowledge, Please dont stop, You are doing great my friend, İ hope you can show us more including three.js, webGL, react etc...
0:30 Once there was a speedrunner named CarlSagan42, who said "let’s do one more". He never stopped doing just one more. I wonder if this’ll end up like that. ;D Love your explanations, keep up with the amazing work!
Not sure where I should ask this. Are you planning on doing a tutorial on modules? The different ways these can be handled in JavaScript is confusing. Thanks and keep up the good work!
How does the sort method knows what to do with the positive or negative values that returns from the compare function? How does it know that it should put the 2nd number at the back if the difference is negative? Wish this video had a tracing of how the .sort(compare) works through an array of numbers like val = [5,3,5,7,8]. Since 5>3, it returns 2, then what does it do next?
i'm very new to js and this is wrecking my brain. what and how does compare() or sort() link the variables "a" and "b" in this case to the elements within the array? how does two variables (a and b) make an array of more than two elements sort itself in whatever order we choose??
Can someone please explain the a - b part because I didn't really get it. As far as I understand it subtracts and gets a negative, a positive and zero number of they're equal. But how does it work. Truthy falsely? But negative num is still truthy, false is 0. And does it sort by ASCII order? Thanks!
Well based on how you have to use the sort function, I assume it works by doing a bubble sort algorithm? or I'm not sure I wonder if using the sort function still is relevant when dealing with extra large arrays :p
What about Date functions? when sorting, if one of the parameters in the object was a Date... ( and the format could be varying). like could b DD-MM-YYYY and time, but we only care about date?
Is there a way to do a sort on 2 keys in JS? For example I wanna sort this [[13, 4] , [20, 2] , [7, 7], [4, 4]] using the element in each item as key, but say if both keys are equal as the first and 4th items in the above array are, how would I go about that. I've managed to find this -> www.sitepoint.com/sophisticated-sorting-in-javascript/ but didn't quite understand what's happening here. Would you mind explaining how this works. Thank you!
how to sort each words in an array like was would be aws, and would be adn and so on... first we sort entire array and then how do we sort each words and print them like below //input let str = 'ram ramesh sahil harsh abhay ali gopi' // output -> 'aabhy aehmrs ahhrs ahils ail amr giop'
i'm Vietnamese student and i was stuck when i try to study in the internet till i find your channel . I'm not good in English so I meet many struggle to learn the definition of some thing new. But with your explaining I can understand the content easily, coding being funny ,i really interesting with your style in teaching ,I never meet one like u in my country. I watch all of them. thanks bro!!!
hey bro, did you learn coding at last ?
1:10 it did not sort it in numerical order. Array.prototype.sort is not sorting numerically. it threats your numbers as strings, therefore an array [3, 21, 10] would be sorted to => [10, 21, 3]
whoa, just confirmed this is the case! Thanks for the correction!
glad i could help :)
Right, it's doing it with the .charCodeAt() function from what I can tell.
so it's using the ascii value? if yes, that would make sense that it prioritises numbers -> capital letters -> lowercase letter
Alright, for those confused like me, here's the explanation.
Sort method changes them to '10, '21', '3' and then checks them. So, the number starting with 1 comes first, that starting with 2 comes next and so on.
If you had [400, 3, 21, 100000], the output after sorting would be [10000, 21, 3, 400].
I really enjoy your videos. When I'm struggling with something on FCC I come to you, and it's a tremendous help. Thanks a lot!
Actually appreciate your humility and its very helpful watching you code from start to finish.
I knew I was definitely going to subscribe to this channel a few minutes into this tutorial. Awesome guy, awesome explanation!!!
I was skeptical at first, but now I am in love with ur teaching. I hope, other videos are that useful too.
This is my favorite video on the internet right now! Thank you ❤
Thank you for explaining this like a normal human being. I completely understand now!
The way he explains is just something different, so noob friendly that it is impossible to not understand. I would recommend his lessons to everyone. Even if you know the topic, just refresh your knowledge to make things even more clear in your mind.
I just want to say, you're terrible at teaching those of us who need a quick answer for those of us on a deadline for a particular project for a client BUT you are absolutely fantastic at helping us understand these concepts on a deep level. I've watched a tutorial series on all of these ES6 topics before. I already use ES6 in my work but I've gone through your whole playlist and it feels I actually understand what I'm writing now (also when to use arrow notation, because prior to this series I've just been writing all my functions as arrow functions just because it was fashionable).
Thanks for the feedback!
from India 18 learning web dev, Loved the way you teach, If you're our teacher we will be very peacefully and happily become the best developers cause we don't have any good teacher like you are. But, in the future, If I get chance to teach I will copy the way you teaches your amazing sir
Imagine you're in an interview and you laugh in front of the interviewer and say "I always forget whether it is (a-b) or (b-a)"😅😅
Did you guys really asked question like that? I'm fortunately never met those kind of interview...otherwise I'd be doomed
@@z3rocodes cool, good luck for your interview!
Tbh for me it's already enough to know the concepts so you know what to google. Nuances are just so optional to remember
honestly this is my first time seeing dude, and i am only 1:56 into this video but i get the feeling hes gonna be super helpful from now on. Thanks for all the effort you put into helping random folk online.
best video i have encounter for comparison function
yes, I've watched all of them
The kind of teacher that keep kids in school 👍
YOU ARE A REALLY GOOD TEACHER. WOW! I'm so glad I stumbled on this.
I loved how he kept getting it backwards, it means I'm even pro coders struggle sometimes
wondeful videos I am learning more from these videos than from most anythoing else I have tried. I like the way you intuitively merge the concepts with the coding and I also like that you make mistakes and explain them when you find them I plan to get through most in not all of your courses, thank you very much.
I sat and watched all of em and I actually learnt more here then what I could learn from wiki libs...
I like your art of teaching. Thank you!
It sorts capitals before smalls because in ASCII formatting, numbers come first, capitals next, smalls last. Somewhere in there all punctuation also fits, you can see their ASCII value to know about that.
i hoped he would have chosen numbers big enough to get sorted between the charaters but he just chose really small ones :(
Yeah, I goofed on this and didn't realize it would not sort numerically.
so detailed! Indian teacher you tubers must watch this.
I learn coding and also save money on coffee by watching this kick ass channel.
In the process of watching all of these videos :-)))))) Thank you !!!!!
there should be a thousand like button on this channel on every vide, i don't feel satisfied just after clicking one after watching him code.
Loved this whole collection of videos. I'm looking forward to the particle system! That's gonna be fun and come in handy too
(it's actually there already if you look for "next video" in the description!)
I love how you explain things! SUBSCRIBED!!
Thanks for share your knowledge, besides you're a good teacher. Greetings from Peru :D
thank you. I really like the way you explain the codes.
Love these videos. Still don't quite understand this but love it either way.
best video -- i have encounter for comparison function
Man thanks so much. You explained this so insanely good.
Eres muy bueno, y gracioso. Hace mas facil querer aprender. Muchas Gracias, desde Argentina.
Thank you So much , I dont know how many times you saved me or explained me subject !!!!!!!! You are the best my friend, İ'm learning web development , We have a small whatsap group, I like sharing your videos to share knowledge, Please dont stop, You are doing great my friend, İ hope you can show us more including three.js, webGL, react etc...
Great video, great teacher, great explanations. Thanks (from Spain) for sharing your knowledge!!!
You're a good teacher my dude Mashallah
watching this at 1.5 or 1.75 gets me so hyped.
I enjoyed your video man. I learned the importance of sort method.
Thanks Danny.
You sir, are worth watching . This. This. This. This.! Lol
This is Gold. ❤
I love this guy.
Amazing explanation God bless you!
You're a lifesaver.
Dude is nuts, subscribed
Very interesting topic. Thank you.
I hate javascipt. It's ugly, poor syntax, poor basic functionality. But I love the way you explain. You are truly a teacher.
I love your work, thank you so much!
I can't believe THE Daniel Shiffman is amazed by ME!
0:30 Once there was a speedrunner named CarlSagan42, who said "let’s do one more". He never stopped doing just one more.
I wonder if this’ll end up like that. ;D Love your explanations, keep up with the amazing work!
Uno mas!
4:49, I came to learn about exactly that :-(
8:24 *THIS IS THE WAY*
Amazing video thanks
Yooo you are the best!❤️
Thank you. from Russia
Helpful video. Thanks :)
Yay! I watched all of them too😁
Not sure where I should ask this. Are you planning on doing a tutorial on modules? The different ways these can be handled in JavaScript is confusing. Thanks and keep up the good work!
Please suggest here! github.com/CodingTrain/Rainbow-Topics/issues
Done, thanks!
very helpful. thank you
How does the sort method knows what to do with the positive or negative values that returns from the compare function? How does it know that it should put the 2nd number at the back if the difference is negative? Wish this video had a tracing of how the .sort(compare) works through an array of numbers like val = [5,3,5,7,8]. Since 5>3, it returns 2, then what does it do next?
I'm not going to sleep before the next video...
I like your energy dude, you make me laugh. You're like Weird Al if he was from...Lebanon? Cyprus? Keep it up
You are the best !!!
This is amazing
i'm very new to js and this is wrecking my brain. what and how does compare() or sort() link the variables "a" and "b" in this case to the elements within the array? how does two variables (a and b) make an array of more than two elements sort itself in whatever order we choose??
Sir can you explain how a function returning -ve value can sort the objects
So the default sort() in javascript uses insertion sort. Do you know if it's still insertion sort if we add a function like in the video?
Can you share any updates on this?
how does the comparing works for the arrow function (a, b) => a - b , how does it do for all array values
Would like to know this too. How does it know what a and b is?
I wish you went over what happens when you use negative number
Please, how do I choose 5 assorted numbers of 10 options ? TKS.
Can someone please explain the a - b part because I didn't really get it. As far as I understand it subtracts and gets a negative, a positive and zero number of they're equal.
But how does it work. Truthy falsely? But negative num is still truthy, false is 0. And does it sort by ASCII order?
Thanks!
Javascript is the best
Now imma learn Haskell
got it ;-) console.log(joe.sort((a,b) => a - b)); // sorts array
but how does it know what a and b is?
Thank you so much !!
Well based on how you have to use the sort function, I assume it works by doing a bubble sort algorithm? or I'm not sure
I wonder if using the sort function still is relevant when dealing with extra large arrays :p
Pretty sure this guy used to be a meteorologist. ☔️
What about Date functions? when sorting, if one of the parameters in the object was a Date... ( and the format could be varying). like could b DD-MM-YYYY and time, but we only care about date?
DO THEM ALL 😳
Appreciate your amazement! lol
how to sort an object only by the name using sort method in js though there are another keys are available
very good!
I want to sort the objects of array as I want, how can I do this?
6:42 ok master yoda lol
Probably you might need new whiteBoard or darker ink which would be more clear to see.
What program do you use for programming?
This workflow video might help:
ruclips.net/video/HZ4D3wDRaec/видео.html
The Coding Train Thank you very much. Really good explained video. Learned allot. Big thanks. Greetings from latvia.
Who are the a and b arguments in the compare functions
I wanna know too. Curious to know what it considers to be a and b
Great 😃 yaaar
I love it
How alphanumeric sorting is possible in Angular??
Is there a way to do a sort on 2 keys in JS? For example I wanna sort this [[13, 4]
, [20, 2]
, [7, 7],
[4, 4]] using the element in each item as key, but say if both keys are equal as the first and 4th items in the above array are, how would I go about that. I've managed to find this -> www.sitepoint.com/sophisticated-sorting-in-javascript/ but didn't quite understand what's happening here. Would you mind explaining how this works. Thank you!
Nice video dan
how to sort each words in an array like was would be aws, and would be adn and so on...
first we sort entire array and then how do we sort each words and print them like below
//input
let str = 'ram ramesh sahil harsh abhay ali gopi'
// output -> 'aabhy aehmrs ahhrs ahils ail amr giop'
fantastic
Funny guy, good video
.sort( ) by default sorts by string unicode point value
I don't understand the compare thing when sorting in order.
Add ture false in stack and sort true ones above
how to short array of objects of boolean property??
aw ye, more coding trainn
Hi! I need a program that can disorder songs in a different order. PLEASE SOMEONE HELP ME TO DO THAT. Sounds easy but this is making me crazy