🎓 New Course Available! "Scrollytelling 101": store.thecodecreative.com/scrollytelling
@teenytinytoons3 жыл бұрын
holy smokes. the most thorough video on a comparator function ever. this made it really click for me. amazing walk-through and explanation.
@TheCodeCreative3 жыл бұрын
Great to hear, thanks for watching!
@romanmontoya59503 жыл бұрын
not only did I fully learn and understand the logic behind the comparator function, but I also found myself starting to relax and peacefully enjoy learning it just by the cadence and tone of your voice. Thank you! Just subscribed
@TheCodeCreative3 жыл бұрын
Excellent! Thanks for subscribing Roman!
@teenytinytoons3 жыл бұрын
1000% percent. He's such a natural.
@23Kattayopp Жыл бұрын
you have no idea how much content i've watched until finding this video that made everything so clear for me! thanks a lot, Gregg!
@TheCodeCreative Жыл бұрын
Glad it helped!
@mondirhallouli4 жыл бұрын
really hits the spot in my ADHD brain! glad I found this video. now I understand the comparator function much better!
@TheCodeCreative4 жыл бұрын
That's great to hear Mondir. 👍🏻 Thanks for watching!
@Nightizm3 жыл бұрын
couldn't' agree more!
@numanakhtersiddiqui65733 жыл бұрын
finally someone explained this in such an easy manner.💕
@TheCodeCreative3 жыл бұрын
Glad to hear!
@e-prog9968 Жыл бұрын
Amazing! Showing the reason why it is sorting the way it sorting was the best part! Thank you!
@TheCodeCreative Жыл бұрын
Glad you enjoyed it!
@kerisek11 Жыл бұрын
I have 4 best-rating courses on Udemy, but this teacher is THE BEST.
@TheCodeCreative Жыл бұрын
Thank you for watching!
@ChabPoha10 ай бұрын
underrated ytber , only vid on yt who perfectly explains the sorting method hats off bro ,
@TheCodeCreative10 ай бұрын
I appreciate that!
@samialvi42263 ай бұрын
This has to be the best every explanation on comparative function! Thanks Mate
@TheCodeCreative3 ай бұрын
Glad it was helpful!
@arinzeodukwe28622 жыл бұрын
Finally, I understood the logic behind this "compareFunction" callback function. Thanks a lot.
@TheCodeCreative2 жыл бұрын
👍🏻👍🏻👍🏻
@syedzidane9402 жыл бұрын
I finally understood the sort method and comparator function but what I don't understand is how come this guy only has around 8K subscribers!?? Given the quality of the content, imo he should have atleast half a million subs
@TheCodeCreative2 жыл бұрын
Thank you, working on it! :-) Happy New Year!
@andresfelipeladinoespitia Жыл бұрын
Thanks my man! I'd been searching for a clear, straightforward, and hands-on explanation to no avail. That's until I got to your video. Great work!
@TheCodeCreative Жыл бұрын
Great, glad it was helpful!
@rich43633 жыл бұрын
i love how thorough you were. i watched it twice and now i can see so many ways that this will be useful.
@TheCodeCreative3 жыл бұрын
Excellent, thanks for watching!
@MrRameez4202 жыл бұрын
why this video has so few views? he literally explained it in a way I'll never forget my entire life!
@TheCodeCreative2 жыл бұрын
Thank you, glad it was helpful!
@locle93893 жыл бұрын
Thank You So Much. I've been flipping through hours of videos and documentations but still struggle to understand what the comparator function do. Your video definitely makes things clearer especially when you wrote out the if statements and have them return -1, 1, and 0. Everything just clicked.
@TheCodeCreative3 жыл бұрын
Glad it helped!
@omarvayani34522 жыл бұрын
for a channel that teaches this well it deserves more subs👍
@TheCodeCreative2 жыл бұрын
Thank you so much 😀
@ravanabuddha39552 жыл бұрын
I was stuck with the problem of writing a custom sort for my nested array and when I found the MDN docs for the topic I couldn't understand the logic behind returning 1, -1 & 0. But sir you explained so well and really saved me & made my day, I can't thank you enough.
@TheCodeCreative2 жыл бұрын
Thanks for watching. More to come!
@farazk97293 жыл бұрын
Thank you so much. a) Very organized explanation and easy to understand. b) Soothing voice in the midst of this confusion called learning. c) Liked and subscribed. Thanks again,
@TheCodeCreative3 жыл бұрын
Great to hear, thanks for watching!
@atmsudawa69252 жыл бұрын
Wow!!! finally i understand this sorting topic in an easier way. The analogy in this video will help even a slow learners thanks
@TheCodeCreative2 жыл бұрын
Glad it was helpful!
@shawnmichaelalberto75193 жыл бұрын
Explained it a lot clearer than other tutorials. You just earned another subscriber!
@TheCodeCreative3 жыл бұрын
Awesome, thank you!
@victoriapanidi14198 ай бұрын
Thank you so much!!! This is one of the best explanation videos that I ever have seen about this topic.
@TheCodeCreative8 ай бұрын
Glad it was helpful!
@65189sumon3 жыл бұрын
Finally I understand Array Sorting. Thank you very much
@TheCodeCreative3 жыл бұрын
Glad it helped!
@tenzinwoeser6842 Жыл бұрын
Really clear explanation. Love how you explain return logic and the charCodeAt logic. Thanks
@TheCodeCreative Жыл бұрын
Glad you liked it
@viveknepal8959 Жыл бұрын
I was so confused before, thank you so much to explain this in such a simple and easier way.
@TheCodeCreative Жыл бұрын
Great to hear!
@btssugahit46632 жыл бұрын
Bro you deserve million of subscribers. I watched a lot of videos before i finally found this masterpiece. Thank you so much it really helped a lot. Hope our professors would teach the way you do.
@TheCodeCreative2 жыл бұрын
Thank you so much 😀 It's encouraging to know that the videos are helpful. 👍🏻
@thedevguild75253 жыл бұрын
Wow you are very good! Probably the best in explaining the comparator function. So far, you might be the only one who show the respective utf code, and also be comprehensive enough to show for alphabets and numbers. Liked plus Subscribed!
@TheCodeCreative3 жыл бұрын
Great, thank you! Glad it was helpful 👍🏻
@mayankverma4638 Жыл бұрын
Hands down the best explanation, Thank you very much!
@TheCodeCreative Жыл бұрын
Glad it was helpful!
@rhoastabotch4 ай бұрын
This is a 10/10 explanation. Thank you so much bro.
@TheCodeCreative4 ай бұрын
Glad it helped!
@stgermanrobert Жыл бұрын
Thanks to this video I could do exercise number 8 of Jonas Schmedtmann's coding challenge about array methods! Thank you so much, nice voice btw!
@TheCodeCreative Жыл бұрын
You're very welcome!
@thecodelife98552 жыл бұрын
thank you for explaining this in depth. Other people were just repeating what was written in w3schools website.
@TheCodeCreative2 жыл бұрын
Great, thanks for watching!
@2010chalupa3 жыл бұрын
I wanted to thank you for the video, I could understand better the a-b logic, and I also had some fun while learning. Keep posting videos like this, means a lot for some of us, even when English is not our first language, we learn a lot.Thanks again.
@TheCodeCreative3 жыл бұрын
That's great to hear. Thanks Ezequiel!
@samuelpalacios96612 жыл бұрын
Finally! What a clear explanation, thank u!! I would love if you make a video explaining what return is :)
@TheCodeCreative2 жыл бұрын
Do you mean "return" as in a return statement within a function?
@samuelpalacios96612 жыл бұрын
@@TheCodeCreative Yup, return statement within a function
@sebastianrodelo79653 жыл бұрын
Thanks!!, this was breaking my head. Greetings from Colombia.
@TheCodeCreative3 жыл бұрын
Great, thanks for watching!
@abhigyansarmah7162 жыл бұрын
That was just too good. Thank you so much for such a lucid explanation. Keep contributing your knowledge. There are very few people out there who can teach concepts in such detail.
@TheCodeCreative2 жыл бұрын
Great, thanks! Glad it was helpful!
@abhigyansarmah7162 жыл бұрын
@@TheCodeCreative It was indeed very helpful. Thanks again.
@leviciarrocchi78954 жыл бұрын
Wow! This video is amazing. I was trying to understand this function and how it works, and with your tips now I understood! Thankyou
@TheCodeCreative4 жыл бұрын
Glad it was helpful to you Levi. Thanks for watching!
@princesamuelyt3 жыл бұрын
i encourage you to do more tutorial , i never have i ever commented on some tutorial videos this was the first one the way that you explain is was so good ,keep doing it
@TheCodeCreative3 жыл бұрын
Great to hear, thanks for watching!
@okaybossiamonyoutubeakkskd2 жыл бұрын
thank you sir for the beautiful explanation. You really deserve a lot more subs
@TheCodeCreative2 жыл бұрын
Thank you too
@robinsajwan59762 жыл бұрын
Sir, your way of explaining is too good, 💎
@TheCodeCreative2 жыл бұрын
Thanks Robin!
@mohammadhosseinjahanbakhsh21593 жыл бұрын
thank u! your channel is underrated
@TheCodeCreative3 жыл бұрын
Thank you!
@akshaydeogaonkar7120 Жыл бұрын
When it was at 09:35 I instantly subscribed! 🤣🤣🤣😇😇
@TheCodeCreative Жыл бұрын
😀 Spice up your life!
@lycan24943 жыл бұрын
the only good video on basic sort so far
@TheCodeCreative3 жыл бұрын
Glad it was helpful!
@쎄쌤독일어2 жыл бұрын
Thank you so much for your excellent explanation. Now I really do understand the logic behind those dubious comparator functions after having read it in a book. Great video! I subscribed right away
@TheCodeCreative2 жыл бұрын
Excellent!
@mitchtembo4874 жыл бұрын
Thank you for this video . Just loved how you thoroughly explained everything . looking forward to learning more topics with you
@TheCodeCreative4 жыл бұрын
Hey Mitch! Thanks for the comment. More videos coming soon 👍🏻
@mightydudegrafuroam84242 жыл бұрын
Simple and concise. Thanks for the vid man!
@TheCodeCreative2 жыл бұрын
Great, thanks for watching!
@girveriusmcfarland57163 жыл бұрын
Sir you are God sent! Thank you so much! It make perfect sense now.
@TheCodeCreative3 жыл бұрын
Great! 👊🏻👍🏻
@FourDollarBill3 жыл бұрын
Exactly what I was looking for. Thank you!
@TheCodeCreative3 жыл бұрын
Glad to hear! Thanks for watching!!
@Khamzat_077 ай бұрын
Literally Perfect ! Just Perfect ! 😘
@TheCodeCreative7 ай бұрын
Thank you so much!!
@sagarsuryawanshi87354 жыл бұрын
Superb explanation , with meaningful insights!!!
@TheCodeCreative4 жыл бұрын
Great to hear, thanks for watching!
@themissingavett3 жыл бұрын
Thanks! you explained this so clearly and thoroughly. Well done good sir.
@TheCodeCreative3 жыл бұрын
Glad to hear, thanks for watching!
@tomasgilamoedo83013 жыл бұрын
Spectacular explanation! really appreciate it, thxz man
@TheCodeCreative3 жыл бұрын
Glad you liked it!
@thydevdom3 жыл бұрын
I think I finally found the perfect pace and instructor….
@TheCodeCreative3 жыл бұрын
Perfect! Thanks Dominik!
@_tanzil_2 жыл бұрын
Wow! You made that easy to understand for me. SUBSCRIBED
@TheCodeCreative2 жыл бұрын
awesome, thanks!
@dapolcio34053 жыл бұрын
The best explanation ever.
@TheCodeCreative3 жыл бұрын
Glad to hear! Thanks for watching 👍🏻
@matt112fly6 ай бұрын
i wasnt sure how the -1 and 0 and 1 affect the returned result.. thanks for claryfing things up !
@TheCodeCreative6 ай бұрын
Awesome!
@masterDarts4188 Жыл бұрын
Thank you for this detailed description, I wanted to ask a question. For the comparitive function , how exactly does it compare the values ? By that I mean, does it take the first number 2, then compare it with the five ? Then does it take the 100 then compare it with the 4 ? Or does it take the 2 then compare it with every other number in the array, then do the same thing with the 5 until it's finished ? It's a small detail, but I curious how exactly it does the sorting.
@alexlions86332 жыл бұрын
great explanation that I have ever seen, thank you
@TheCodeCreative2 жыл бұрын
Glad you enjoyed it!
@codebykeoma3 жыл бұрын
Great video! I am clearer on this topic now.
@TheCodeCreative3 жыл бұрын
Excellent!
@edwinly98653 жыл бұрын
Seriously well explained! !
@TheCodeCreative3 жыл бұрын
Thanks for watching Edwin!
@deus34043 жыл бұрын
THANK YOU! Keep up the good work!
@TheCodeCreative3 жыл бұрын
Thank you!
@mirelahi22912 жыл бұрын
such a good content! Keep up the good work. Thanks.
@TheCodeCreative2 жыл бұрын
Thank you for watching!
@abdurahmanargoebie31493 жыл бұрын
Thanks for your explanation make me understand about sort function javascript👍
@TheCodeCreative3 жыл бұрын
Excellent! Any other topics you'd like to see a video on?
@andromilk2634 Жыл бұрын
Hi, thanks for the very clear explanation, it's the first video I see which explains it in depth to this extent. There's just something which I was wondering about the comparator function : how exactly does it do the comparison between the different elements in the array? What exactly is happening behind the scenes? Some special kind of algorithm is implemented to compare the elements in a certain order? (is the first element compared to all the other elements of the array, then the second to all the others until the end, etc. or something else?) Hopefully my question makes sense.
@neo90sr3 жыл бұрын
Just what I was looking for, very clear explanation. Thanks 👍
@TheCodeCreative3 жыл бұрын
Great to hear!
@itsreason3238 Жыл бұрын
Thank you. I like to learn how and why something is the way it is. I intend to reverse engineer the sort method myself to fully understand and appreciate the method. I think I can do it by using nested for loops and conditional logic.
@TheCodeCreative Жыл бұрын
Right on!
@muneebnawaz13923 жыл бұрын
Thanks.. you just explained it in simplest way💖
@TheCodeCreative3 жыл бұрын
Excellent, thanks for watching!
@shubhamh74513 жыл бұрын
Thank you so much, pretty clear explaination! subbed
@TheCodeCreative3 жыл бұрын
Thanks for the sub!
@éosingas2 жыл бұрын
Im pretty sure you could teach an Ant to become an austronaut, but for real, i wasn't understanding it clearly but you made it simple for me, thank you!
@TheCodeCreative2 жыл бұрын
Glad I could help!
@nehalsingh7859 күн бұрын
Awesome Explanation
@TheCodeCreative9 күн бұрын
Glad it was helpful!
@SamShiFitness4 жыл бұрын
Woow Thank Budy !!! Finally i understand a-b or b-a Thank You So Much Brother Keep It Up
@TheCodeCreative4 жыл бұрын
That's great to hear, thanks for watching!
@mardokahvejian48472 жыл бұрын
you are the best explainer thank you so much
@TheCodeCreative2 жыл бұрын
Thank you!
@mohamedyoussef88353 жыл бұрын
best explanation 🙂
@TheCodeCreative3 жыл бұрын
Thanks Mohamed!
@georgeem99542 жыл бұрын
Clearly explained.Thank you
@TheCodeCreative2 жыл бұрын
Glad it helped! Feel free to join the Facebook group: facebook.com/groups/thecodecreative
@fullStackInKannada2 жыл бұрын
Very nice explanatory, thank you so much for that.
@TheCodeCreative2 жыл бұрын
Thanks for watching!
@compean73603 жыл бұрын
Finally I could understand, thanks!
@TheCodeCreative3 жыл бұрын
Glad it helped!
@subhashgn17753 жыл бұрын
Thank you. Very well explained.
@TheCodeCreative3 жыл бұрын
Thanks for watching!
@ricardotijerina8863 жыл бұрын
Wow! Good job mate! Very well explained. New sub. 👍🙋🇲🇽😁
@TheCodeCreative3 жыл бұрын
Thanks Ricardo and thanks for watching!
@AbdulhafizTurdimuhammedov-s5e11 ай бұрын
Thank you, It was really useful
@TheCodeCreative11 ай бұрын
Glad to hear that!
@ShopperPlug2 жыл бұрын
Excellent explanation.
@TheCodeCreative2 жыл бұрын
Glad to hear!
@FiveFourThor2 жыл бұрын
amazing tutorial!! 😁
@TheCodeCreative2 жыл бұрын
Cool, thanks!
@AlphaWatt2 жыл бұрын
This is great. Thank you very much!
@TheCodeCreative2 жыл бұрын
Glad it was helpful!
@aravindm61243 жыл бұрын
fantastic explanation !!!! , Thanks much!!!😀
@TheCodeCreative2 жыл бұрын
Glad it was helpful!
@0xR3Ze3 жыл бұрын
Thank You, I hope you get more views Sir!.
@TheCodeCreative3 жыл бұрын
Thank you too!
@rameenana Жыл бұрын
Thanks man. This was helpful.
@TheCodeCreative Жыл бұрын
Great to hear!
@sirinongorur56764 жыл бұрын
Very good video with a good explanation!!
@TheCodeCreative4 жыл бұрын
Thanks Sirin, glad to hear!
@VanVlearMusic11 ай бұрын
This was great, thank you!!
@TheCodeCreative11 ай бұрын
Glad it was helpful!
@StrangerDanger352 Жыл бұрын
Loved it you teaching so good Thank you :)
@TheCodeCreative Жыл бұрын
Glad it was helpful!
@draganbogdan42672 жыл бұрын
Great teacher!
@TheCodeCreative2 жыл бұрын
Thanks Dragan!
@josephisaac6664 Жыл бұрын
a tiny correction, in the comparator function, the first argument(a) is actually the second value of a pair of adjacent values being compared. So in the case of [2, 5, 100, 4], on the first iteration, a is 5 and b is 2. It's a little counter intuitive but in that case, a < b means 5 < 2. If true, we return a negative number, which means a should be before b, that is 5 should be before 2. (This is false) Else if a > b i.e., 5 > 2, we return positive number, which means b should be before a, that is 2 should be before 5. (This is true)
@SumoLife3 жыл бұрын
Superb explanation!
@TheCodeCreative3 жыл бұрын
Glad it was helpful!
@pranabroy82183 жыл бұрын
Very well explained.
@TheCodeCreative3 жыл бұрын
Thanks for watching!
@gemrwx Жыл бұрын
The first iteration a is going to take the value of the second item in the array and b is going to take the first item of the array. [5, 2] comparatorFunction(a, b) // a = 2 and b = 5
@Thikondrius Жыл бұрын
I see indeed, do you know why ?
@amedeocalzolai1562 жыл бұрын
Great explanation thanks 🙏
@TheCodeCreative2 жыл бұрын
Thank you for watching!
@sumaganjal2 жыл бұрын
Thank you, finally understood
@TheCodeCreative2 жыл бұрын
Great! 👍🏻
@hasnainAliDev4 жыл бұрын
Cool Explanation I was looking for long time...thanks TCC(TheCodeCreative)
@TheCodeCreative4 жыл бұрын
Glad it was helpful Hasnain Ali, thanks for watching!
@Kiarash70423 жыл бұрын
thank you very much you explained it very well
@TheCodeCreative3 жыл бұрын
Thanks for watching!
@penguinxed2 жыл бұрын
well explained sir, thank you :)
@TheCodeCreative2 жыл бұрын
Most welcome!
@ShubhamPal-yi9kp2 жыл бұрын
thanks for the teaching
@TheCodeCreative2 жыл бұрын
Thank you for watching!
@btw_alya Жыл бұрын
really really thanks a lot🙏🙏 this makes all clear for me about sort method thanks to you🙏 i really appreciate your efforts sir🙏 thank you so much this is really appreciable🌸✨ thank you once again for saving me✨