map, filter & reduce 🙏 Namaste JavaScript Ep. 19 🔥

Map, filter & reduce Array functions are the most popular Higher-Order Functions in JavaScript. This episode covers map(), filter() & reduce() along with 11 detailed code examples from easy to tricky ones(The last example is the Best). You'll also find homework towards the end of this episode. ❤️
The only request is to watch this Episode of Namaste JavaScript with full attention. 🙏
My tech gear I use every day - google.peek.link/2pba
00:00 - Introduction
00:40 - Array.map() function in JavaScript
01:39 - Example 1 - map
03:23 - Example 2 - map
04:01 - Example 3 - map
06:43 - Array.filter() function in JavaScript
07:03 - Example 4 - filter
09:00 - Example 5 - filter
09:26 - Example 6 - filter
11:36 - Array.reduce() function in JavaScript
12:18 - Example 7 - reduce
18:41 - Example 8 - reduce
23:07 - Example 9 - tricky map()
25:40 - Example 10 - tricky reduce()
31:49 - Example 11 - Chaining map, filter & reduce
35:31 - Homework - Challenge
36:30 - Teaser of the Next Video
37:14 - Thank you for watching Namaste JavaScript 🙏
Support this web series, NOT BY MONEY, but by sharing it on social media.
please give a shoutout to Namaste JavaScript and help me reach more people. 🙏
I'll give my best to come up with great content and everything absolutely for free on KZread. 😊
Cheers,
Akshay Saini
akshaysaini.in
Would love to Stay Connected with you ❤️
LinkedIn - / akshaymarch7
Instagram - / akshaymarch7
Twitter - / akshaymarch7
Facebook - / akshaymarch7
#NamasteJS #AkshaySaini

Пікірлер: 2 400

  • @ramdey6155
    @ramdey61552 жыл бұрын

    Hi Aksahy, I am so grateful to you... You make my javascript concepts so clear that , I got offer from 5 companies and going to join a good company with 110% hike. I really believe your content is worth payable. Thank you so much 🙌🙌🙌🙌 Keep educating and spreading love and knowledge. 🥳🥳🥳

  • @akshaymarch7

    @akshaymarch7

    2 жыл бұрын

    Congratulations, Ram 🎉 Wish you a great career ahead! ♥️

  • @ramdey6155

    @ramdey6155

    2 жыл бұрын

    @@akshaymarch7 Thank you souch 😀

  • @ParameshChockalingam

    @ParameshChockalingam

    2 жыл бұрын

    Just so you know, you are like that one friend who teaches entire subject few hours before exam 😎

  • @gopathotirajesh6956

    @gopathotirajesh6956

    2 жыл бұрын

    @@akshaymarch7 bro where are you . Please do continue this series. I think there is no one explains the things like you. Please don't stop making videos.

  • @Abhishek-do8mp

    @Abhishek-do8mp

    2 жыл бұрын

    @@akshaymarch7 hello akshay, I don't know wether you are active or not but please consider our request and upload few more videos on topics like async await, promises, spread and rest operators I believe only you can cover these topics with greater depth of understanding hopefully you're seeing this comment and wish I'd see your smile in upcoming videos this is 22k already thanks for spreading that amount of knowledge on youtube you're one of the reason I tell my juniors that you can learn anything from yt javascript se pyar to krva diya lekin is pyar ko manjil tk to pahucha do.

  • @jagrutsharma9150
    @jagrutsharma9150 Жыл бұрын

    Things learned: 1. map method is used when we want transformation of whole array. 2. filter is used when we want to filter the arrar to obtain required value. 3. reduce is used when we want to reduce the array to single value eg (max, min, avg, sum, difference etc). 4. reduce passes two arguments one function(which includes accumulator and initial value as argument itself) and another initial value of accumulator. 5. Homework: const output = user.reduce(function(acc, curr){ if (curr.age acc.push(curr.firstName); } return acc; }, [ ]) console.log(output);

  • @lakshyapant5225

    @lakshyapant5225

    Жыл бұрын

    bro agr mai return acc ko if k andrr likh rha hu toh error aa rhi hai so what's the reason behind it....please explain?

  • @jagrutsharma9150

    @jagrutsharma9150

    Жыл бұрын

    @@lakshyapant5225 Kyuki accumulator(acc) ki pehli condition me hi aapne return kar diya. Vo function se exit ho jaayega, aage ka process ruk gaya pura.

  • @neharathour6115

    @neharathour6115

    Жыл бұрын

    Amazing

  • @ganeshbyale5024

    @ganeshbyale5024

    Жыл бұрын

    I tried this homework directly in console but throwing error related to acc.push

  • @jagrutsharma9150

    @jagrutsharma9150

    Жыл бұрын

    @@ganeshbyale5024 Can you tell the error. Maybe i will be able to help you. Maybe copy paste your code and error

  • @mohammadnoushadsiddiqui4786
    @mohammadnoushadsiddiqui47862 жыл бұрын

    I complete the homework const user = [ { firstname: "Mohammad", lastname: "Noushad", age: 22 }, { firstname: "Aniket", lastname: "Bhalla", age: 45 }, { firstname: "Bidhi", lastname: "Chand", age: 21 }, { firstname: "Saif", lastname: "Siddiqi", age: 67 }, ]; const output = user.reduce((acc, current) => { if(current.age acc.push(current.firstname); } return acc; }, []); console.log(output);

  • @debo01

    @debo01

    2 жыл бұрын

    const output = user.reduce((acc, curr) => { if(curr.age acc.push(curr.firstname); } return acc; }, {} );

  • @vinothkumarv9722

    @vinothkumarv9722

    2 жыл бұрын

    Thanks akshay bro love you...

  • @ganeshkg007

    @ganeshkg007

    2 жыл бұрын

    Hi, @@debo01 No, this will not work because you initialized the reduce function with object literals {}. Since we are pushing (.push) the results we should use an array for initialization, just like @Mohammad Noushad Siddiqui did. Thanks.

  • @iftekhar_ansari

    @iftekhar_ansari

    2 жыл бұрын

    @@debo01 no its wrong..you can't use push method to insert a data in object ,push is array 's method

  • @lingangoudad8552

    @lingangoudad8552

    2 ай бұрын

    How to put these first names into an object?

  • @ebukaavatar3007
    @ebukaavatar3007 Жыл бұрын

    I'm a Nigerian who has been struggling to understand these concepts with some of my friends. I love how you add jokes and giffs while teaching. You just earned 12 subscribers(I and my 11 friends)

  • @prikshit8

    @prikshit8

    Жыл бұрын

    That’s 12 my friend 😂

  • @prikshit8

    @prikshit8

    Жыл бұрын

    @@hailea726 😂😂

  • @stephen2824

    @stephen2824

    Жыл бұрын

    @@hailea726 and you will all be forever in a friendship closure :)

  • @prathameshyerva7476

    @prathameshyerva7476

    5 ай бұрын

    Another 11 subscribers brother ( I and my 12 friends)

  • @amodpatwa1822
    @amodpatwa1822 Жыл бұрын

    Hi Akshay, I just finished your "Namaste JavaScript - series 1" course. I can't say how much confident I am in JavaScript now just because of you. Thank you so much for making this amazing video series on JavaScript. Homework solution: const users = [ { firstName: "Akshay", lastName: "Saini", age: 26 }, { firstName: "Donald", lastName: "Trump", age: 75}, { firstName: "Elon", lastName: "Must", age: 50}, { firstName: "Deepika", lastName: "Padukone", age: 28} ]; const output = users.reduce(function(acc, curr) { if (curr.age acc.push(curr.firstName); } return acc; } , [ ] ); console.log(output); P.S - from today onwards, I am naming you "The Amazing - Akshay Saini" Regards, Your Well-wisher and a learner

  • @rahulprajapati8052
    @rahulprajapati80522 жыл бұрын

    Today I learnt 4 things from this video 1. Map function 2. Filter function 3. Reduce function 4. Deepika Padukon is still 26 Awesome video Akshay 👌👌👌

  • @akshaymarch7

    @akshaymarch7

    2 жыл бұрын

    Hahaha 🤣

  • @dipenchavda6988

    @dipenchavda6988

    2 жыл бұрын

    No she is not 26

  • @KPoireiNgambaSingha

    @KPoireiNgambaSingha

    2 жыл бұрын

    i guess her age got "mapped" or "reduced" to 26. pun intended 😆😋

  • @AchayanIn

    @AchayanIn

    2 жыл бұрын

    @@KPoireiNgambaSingha but you 'filtered' some years after 26 😂😂

  • @abacas2175

    @abacas2175

    Жыл бұрын

    kudos to Deepika😂😂

  • @sohamderoy2505
    @sohamderoy2505 Жыл бұрын

    Solution of the homework: const output = users.reduce((prevVal, currVal) => { if (currVal.age prevVal.push(currVal.firstName); } return prevVal; }, []);

  • @abhisekgupta4678

    @abhisekgupta4678

    Жыл бұрын

    the thing is the output is not an array it doesn't have []

  • @shrimalishrimali7170

    @shrimalishrimali7170

    Жыл бұрын

    Exactly, that's the same thing i thought

  • @mohitbansal321

    @mohitbansal321

    Жыл бұрын

    @@abhisekgupta4678 you need only name so it make output in the form of array

  • @apamibrahim1736

    @apamibrahim1736

    8 ай бұрын

    ​@@mohitbansal321yh😊

  • @mayurtanna3692

    @mayurtanna3692

    8 ай бұрын

    const max30 = people.reduce((acc, curr) => { if (curr.age > 30) { // acc = curr.firstName; acc = curr.firstName + " " + curr.lastName } return acc; }, {}); console.log(max30)

  • @akshaykrishna7292
    @akshaykrishna72923 ай бұрын

    Brother - you are so natural in explaining these concepts! Big thanks 🙏 let belowFortyReduce = users.reduce((res, user) => { if (user.age

  • @gratusrichard1644
    @gratusrichard16442 жыл бұрын

    dude, you are a legend. I never saw anyone who explain a program the way you do. not just telling if you do this, this will happen, instead showing how it is happening. If you could upload the same way of teaching for other programs as well, it would be really amazing. I wouldn't mind to pay for such an golden content. also your smile really makes this course very enjoyable to watch. thankyou again

  • @georgetsintsadze8981
    @georgetsintsadze89812 жыл бұрын

    Man your tutorials are so addictive, I don't want to study from other resources. You're like a good music band and we are fans that are waiting for new "songs". Please continue this awesome series 🙏🙏🙏

  • @g_pazzini

    @g_pazzini

    6 ай бұрын

    same here

  • @pranavkuchimanchi3192
    @pranavkuchimanchi3192 Жыл бұрын

    // Code for the challenge given at 36:05 const outputlist = users.reduce((names, user) => { if(user.age names.push(user.firstname); //can also use names.unlist(user.firstname); } return names; }, []);

  • @vidushikagupta2900

    @vidushikagupta2900

    5 ай бұрын

    can you please explain why you use [] instead of empty object {}

  • @vidushikagupta2900

    @vidushikagupta2900

    5 ай бұрын

    @@ShrikantKunte Thanks

  • @SonuKumar-yu6yh

    @SonuKumar-yu6yh

    3 ай бұрын

    because in the final output we need an array of first names of users whose age is less than 30 @@vidushikagupta2900

  • @GobindaDas-yt

    @GobindaDas-yt

    6 күн бұрын

    I also did the same broh

  • @lopamudrasahoo8663
    @lopamudrasahoo8663 Жыл бұрын

    Thank you for making me fall in love with Javascript again. Revisiting is always hard but with your videos, I am getting some new out from the same concepts.

  • @atharvagarwal2067
    @atharvagarwal20672 жыл бұрын

    Please continue this series sir ,as we want to learn more about things like promises , async-await , fetch api , OOPS in javascript and more on functional programming.

  • @mohitkushwaha8156
    @mohitkushwaha81562 жыл бұрын

    You are a true godsend! You’ve got all of the best qualities of a good teacher. Without you, I wouldn’t have made it through.

  • @victortarroni
    @victortarroni Жыл бұрын

    No words can express, how grateful I am for your explanation. you killed it! THANK YOU!

  • @harshitakohli9308
    @harshitakohli930810 ай бұрын

    Here is my solution: const output = users.reduce(function(acc, curr){ if(curr.age acc.push(curr.firstName); //if age of current user is } return acc; }, [ ]); //initially, the acc will be an empty array console.log(output); Thanks Akshay for such a crystal clear explanation!!

  • @mayankkumar6091
    @mayankkumar60912 жыл бұрын

    I am in more love with Javascript after watching "Namaste Javascript". I have shared it with all of friends and colleagues to strengthen their knowledge about JS. Words are not enough to explain the value of this series. Thanks for making this series for everyone with pure love and dedication ❤

  • @omkart2854
    @omkart28542 жыл бұрын

    Best explanation for all this important array methods!! Reduce example- Const output=users.reduce((acc,curr) =>{ If(curr.age

  • @pankarton5950

    @pankarton5950

    2 жыл бұрын

    Why not acc.push(curr.firstName)? XD

  • @jahangagan5396

    @jahangagan5396

    2 жыл бұрын

    const output = users.reduce((acc, cur) => { if (cur.age return acc }, [])

  • @giannizamora7247

    @giannizamora7247

    2 жыл бұрын

    @@jahangagan5396 I like your answer jahan that is what I came up with. I don't really understand Omkar answer of acc = [...acc, curr.firstName]; why are we using spread syntax here

  • @jahangagan5396

    @jahangagan5396

    2 жыл бұрын

    @@giannizamora7247 It is the another method of pushing elements into the array nothing else.

  • @faizanabbas839

    @faizanabbas839

    2 жыл бұрын

    @jahan gagan Write a PURE function using map,filter and reduce methods to calculate the income tax given an amount. 0 upto 2.5L, 5% for 2.5L-5L, 20% for 5L-10L, 30% for more than 10L. Can you help me with this please

  • @ayushjain8156
    @ayushjain8156 Жыл бұрын

    Please cover the following topics: 1. async/await 2. Observables 3. Promise

  • @known878

    @known878

    Ай бұрын

    Done in season 2

  • @Anna-dd4wy
    @Anna-dd4wy Жыл бұрын

    I am a beginner and always get confused and overwhelmed by these topics. After watching a bunch of videos, this is the only video that gave a beautiful insight about the concept and its functionality in real world problems. Appreciate the efforts you take in making such videos. Cheers!!!

  • @KishanKumar-gr1wo
    @KishanKumar-gr1wo2 жыл бұрын

    11:49 Found the answer for why reduce is named so. According to an article on digital ocean - "A reducer will only return one value and one value only hence the name reduce." In simple terms, it reduces the array to a single value.

  • @athilnath
    @athilnath2 жыл бұрын

    I was learning reduce from the video by coding myself and when I tried without assigning an initial value to the acc argument, the first element in the array was assigned to it automatically and the second element was assigned to the curr argument, just sharing an interesting fact, you are a great teacher ❤️❤️

  • @sameersahu4569
    @sameersahu4569 Жыл бұрын

    After completing this series i can surely say that i have started to understand the JS concepts better...also the internal working thing was just top notch explanation...... The biggest takeaway from you that you always put on a smile on your face...and when you can teach us with enthusiasm...i can also learn smiling.... Thank you for this amazing series... Waiting for Season 2

  • @raimundoladrondeguevara8597
    @raimundoladrondeguevara8597 Жыл бұрын

    Hey man, thanks A LOT for your tutorials! They are the most comprehensive I've found on KZread for JS. Keep it up!

  • @jagannathpanigrahy7524
    @jagannathpanigrahy75242 жыл бұрын

    Sir, Please complete Namaste Javascript series. This is a request on behalf of all javascript developers..

  • @vijaypanchal7344
    @vijaypanchal7344Ай бұрын

    Striving for a comprehensive understanding of all concepts is commendable.

  • @TinyMaths
    @TinyMaths Жыл бұрын

    Thanks; one hour ago I only knew about filter() because I saw it on the FreeCodeCamp but hadn't gotten to the lesson yet. Now I have a good basic understanding and am going to use it to reformat previous projects.

  • @brijesh220186
    @brijesh2201862 жыл бұрын

    Loved this JS series... The way you cover each topic is awesome... Easy to understand and remain forever. Thank you ❤️

  • @user-uv5py8zi1w
    @user-uv5py8zi1w2 жыл бұрын

    You're such an excellent teacher. PLEASE DON'T STOP

  • @kartikgupta3234
    @kartikgupta3234 Жыл бұрын

    The following snippet will do the work : users.reduce((acc, curr) => { if(curr.age acc.push(curr.firstName); return acc; }, []); Thank You so much, Akshay for such great content !!

  • @Pankaj-ul4yo
    @Pankaj-ul4yo Жыл бұрын

    The way you explain the concepts, engage people and have fun while learning, you're simply amazing Akshay

  • @vishwavignesh586
    @vishwavignesh5862 жыл бұрын

    Thank you so much Akshay, I was able to crack an interview because of this namaste javascript series. This series has literally changed my life! Keep up the amazing work 🔥

  • @klutzy_
    @klutzy_2 жыл бұрын

    I've watched many tutorials on this topic, but this one is truly the best!

  • @katedelsignor6670
    @katedelsignor6670 Жыл бұрын

    I have been going crazy trying to figure out these concepts. Thank you for making them so clear!!!!! Subbed.

  • @aadriovijay7244
    @aadriovijay7244 Жыл бұрын

    Hi akshay. Today I have completed this season second time. I feel very confident in js fundamentals. while watching first time i cannot able to solve some the problem. Now I can able to solve. Thank you so much Akshay!! by using reduce const output = users.reduce(function(acc, curr){ if(curr.age

  • @barrosofilho42
    @barrosofilho422 жыл бұрын

    Esses indianos sabem demais. Tu é doido! Salvando sempre. Namastê 🙏

  • @piyushchandrachandra
    @piyushchandrachandra2 жыл бұрын

    You made this sooo simple to understand!! The reason why this playlist is soooooooo popular! Keep posting great contents.

  • @akshayasalaskar9102
    @akshayasalaskar9102 Жыл бұрын

    Watching you explain JavaScript is like a treat to the brain. Kudos to this guy❤❤❤

  • @TW-uk1xi
    @TW-uk1xi2 ай бұрын

    After you've cleared all my basics, now I feel like JavaScript is like water and it's really exciting.

  • @shalinikarkera2387
    @shalinikarkera23872 жыл бұрын

    I regret for not finding your channel earlier :( still neva too late :) . So much clarity and that eager to make viewers understand the topic. Hats off. Thanks a lot.

  • @yogeshsharma5168
    @yogeshsharma51682 жыл бұрын

    I'm so happy that I started this series.. I feel so confident now Thank you aksay❤️💯🙌

  • @mayurwankhade7447
    @mayurwankhade7447 Жыл бұрын

    const output = users.reduce((acc, curr) => { if (curr.age return acc; }, []); console.log(output); Brind polyfill of map, filter and reduce. this is one of the best video😍

  • @purvijha4289
    @purvijha42892 жыл бұрын

    Can we please get a graphql and react series with this much depth your quality of course is far far good than those paid courses

  • @joeljacob4685
    @joeljacob4685 Жыл бұрын

    Thank you so much for the wonderful series !! I think i am finally beginning to understand the beauty of JavaScript🤩😍

  • @hmnaqash7297
    @hmnaqash729710 ай бұрын

    Thank you Akshay for creating the amazing advance JavaScript content. I would like to highlight that your content is highly comprehensive and in-depth, making it necessary for beginners to dedicate around 4 to 5 months to fully grasp these advanced topics. In my opinion, it would be beneficial if you clearly emphasize that individuals who are interested in progressing and finding job opportunities should consider learning React. React provides a more accessible understanding of topics like arrow functions, conditional rendering, and higher-order components. By shifting their focus to React, beginners can avoid getting stuck in JavaScript alone and increase their chances of securing employment.

  • @AakashGoplani
    @AakashGoplani2 жыл бұрын

    11:50 - Name reduce was assigned with a purpose to maintain similarity between languages. We have similar reduce (and map, filter as well) in other languages also - Java, Python, Scala, Ruby etc. So having a consistent naming convention will be very easy for developers to get up and running when they switch from one language to another!

  • @asadrahman6123

    @asadrahman6123

    Жыл бұрын

    also it reducing from multiple value(array) to single value

  • @akshaymarch7
    @akshaymarch72 жыл бұрын

    All Episodes of Namaste JavaScript Web Series: kzread.info/head/PLlasXeu85E9cQ32gLCvAvr9vNaUccPVNP ✅After watching this video, do let me know in the comment, How was the video? I read all the comments, would love your feedback! ❤️

  • @SatyendraSingh-mu2ux

    @SatyendraSingh-mu2ux

    2 жыл бұрын

    Okay but your videos always awesome thnx

  • @sohillalakiya9254

    @sohillalakiya9254

    2 жыл бұрын

    Please suggest me js book which helps me to learn js from beginner to pro and thanks for this beautiful video❤️

  • @sadavhusain2126

    @sadavhusain2126

    2 жыл бұрын

    Video was amazing Thanks bro Please make video on arrow function and regular function

  • @yashpatel3114

    @yashpatel3114

    2 жыл бұрын

    @Akshay Saini Sir, Can you please make a video on a small project using all these concepts, with HTML CSS JavaScript, for beginners? So that we know where and how these concepts of your previous videos are used. I know that we can google the project, but your explanation is the best and we can understand all the concepts clearly. Only if it is possible and if it doesn't bother you to show a small project. Thankyou Sir. Please consider😊

  • @deepakkelath4772

    @deepakkelath4772

    2 жыл бұрын

    Super simple explanation

  • @eshagoyal6114
    @eshagoyal6114 Жыл бұрын

    Thank you so much @Akshay Saini for this series. It made me understand all the basics of JavaScript that I need to know. It was so good, from your explanation to the music in the end of every video.

  • @KiranKumar-hz8ur
    @KiranKumar-hz8ur2 жыл бұрын

    It's the best series to learn js I have ever seen 🤩 Please upload atleast one video per week in this series 🤝 It will be very helpful 🙏

  • @venkyakshaya
    @venkyakshaya2 жыл бұрын

    Hey Akshay 😍 I landed a fully front end position at Adobe. You are a gem Your tutorials were like a one place stop. I didn’t refer to any other documentation or tutorial. Made my life easy. Thank you so much ❤️❤️ This community is awesome because of people like you 🔥

  • @Abhishek_Poddar

    @Abhishek_Poddar

    2 жыл бұрын

    first of all a very congratulations Akshaya ma'am , it will be a very kind of you if you may tell from where did u referred rest of the topics of this series , from where Akshay saini sir left this series ????

  • @venkyakshaya

    @venkyakshaya

    2 жыл бұрын

    @@Abhishek_Poddar Could you tell me what you mean by rest of the topics? Interviews mostly cover the fundamentals. There were no targetted question based on syntax so in my view I think if you complete this playlist you can answer most interview questions on JS.

  • @vaishaliajmera2197
    @vaishaliajmera2197 Жыл бұрын

    Hi Akshay Sir, I have seen so many videos of array map, reduce but never understand it fully. But today, I am able to get deep down knowledge and power of these functions. Thank you so much sir, for making this video. Please make video on React JavaScript. It will help us a lot.

  • @Muwahid999
    @Muwahid9999 ай бұрын

    Thank you sir for awesome explanation (watched videos of other popular web dev channels but none of them have explaned in such beautiful way)

  • @nagsai7401
    @nagsai74012 жыл бұрын

    I don't know but, after seeing notification from namaste javascript I got goosebumps 🔥 🔥, is that the same with everyone !

  • @Fatima-ie5kj

    @Fatima-ie5kj

    2 жыл бұрын

    @@roshnis8552 yup

  • @vinothkumarv9722

    @vinothkumarv9722

    2 жыл бұрын

    Exactlly bro ------------------- he is auper man :)

  • @cornensue

    @cornensue

    2 жыл бұрын

    Yes yes yes....

  • @tauseefanwardo

    @tauseefanwardo

    2 жыл бұрын

    Yes bro and you should have that goosebumps.

  • @sujendragharat9645
    @sujendragharat96452 жыл бұрын

    Hats off to you Akshay for the Content. const output = users.reduce((acc, curr) => { if (curr.age acc.push(curr.firstName) } return acc }, []);

  • @ranjithasampangi7644
    @ranjithasampangi764411 ай бұрын

    const output1 = users.reduce((acc, curr) => { if (curr.age acc.push(curr.firstName); } return acc; }, []); console.log(output1); Thanks a lot!!!!!! Really i was always frustrated with reduce cause i could not understand completely and found it hard. you just made it so easy n i solved all the extra problems before watching your solution. I just love the way you teach and make it so simple that anyone could understand

  • @subhashisbhowmik7
    @subhashisbhowmik7 Жыл бұрын

    Bhaiya more videos are needed. Abi to maza aa hi rha tha, please don't stop making these awesome videos.

  • @siddharthabose9957
    @siddharthabose99572 жыл бұрын

    const output2=users.reduce(function(acc,curr){ if(curr.age

  • @nitingupta1650
    @nitingupta16502 жыл бұрын

    I believe in Namaste Javascript supremacy! Akshay Saini for the president xD

  • @akshaymarch7

    @akshaymarch7

    2 жыл бұрын

    🤐

  • @vidushikagupta2900
    @vidushikagupta29005 ай бұрын

    Hi Akshay Sir Thank you for sharing your knowledge I was so confused about the concepts and pull my hairs like how the things done but with your way of teaching and your support make me fall in love with the javascript and now I understand the concepts way better than before . Thank you Thank you Thank you Thank you Thank you Thank you a big Thank you for sharing your knowledge with us.

  • @info-prog
    @info-prog Жыл бұрын

    I'm too late may be to say this, but i can affirm : it's the best course about explaining map, thank you so much Saini.

  • @sumeetyeola4576
    @sumeetyeola45762 жыл бұрын

    Liked before watching whole video coz I know it's going to be great. Was waiting for your new video, welcome back ♥️

  • @yashsinghania1567
    @yashsinghania15672 жыл бұрын

    Akshay Bhaiya , Please start a small course or a bootcamp for JS from basic concepts to advanced , this content is gold , we need more of your explanation in various concepts and functional concepts. #JSbyAkshaySaini

  • @piyushtiwari6471
    @piyushtiwari6471 Жыл бұрын

    WOW! if only had i watched these videos of your for JS and all these functions before diving into React and full stack MERN projects, i would have understood them so much better. Now i understand why am i not able go beyond 2-3 rounds of companies in last 2 weeks. Anyway der aaye durust aaye

  • @tonikroos6895
    @tonikroos6895 Жыл бұрын

    how much keen you are to teach us in depth..., hats-off

  • @sourav_96
    @sourav_962 жыл бұрын

    Din ki suruat js ke sath 🔥

  • @RyleeSmyth
    @RyleeSmyth Жыл бұрын

    I know I'm already late for this but I have finally completed this JS tutorial today. It's just amazing and I don't have any words to describe and YES along with falling in love with JS, I fell in love with Akshay too 😊

  • @rajurathod-rg6pv

    @rajurathod-rg6pv

    Жыл бұрын

    same😇🤩☺

  • @devmittal3095
    @devmittal3095 Жыл бұрын

    Hi Akshay, really loved the whole Namaste Javascript Playlist, got to learn some really amazing stuff from you. Here is the code of the last question using reduce: const output = users.reduce(function (acc, curr) { if (curr.age acc.push(curr.firstName); return acc; }, []);

  • @Kelz_369
    @Kelz_3693 ай бұрын

    Another awesome video! I'm binging this whole series. Thank you so much for your hard work and efforts on putting this content together.

  • @FrontendFLow811
    @FrontendFLow8112 жыл бұрын

    Hum first hum first 😂 Namaste JS is finally here 🔥🔥🔥

  • @rohitkumarkhatri2203
    @rohitkumarkhatri22032 жыл бұрын

    Amazing work! Watched the full playlist in a single session... It was more interesting than Squid Game...

  • @varathannk264
    @varathannk264Ай бұрын

    After watch this video I got better understanding in map,filter,reduce Thank you so much

  • @vinaygupta6233
    @vinaygupta6233 Жыл бұрын

    after watching your videos this concepts got clear . thank you so much sir and i really like that meam part.

  • @akshaybhinge8780
    @akshaybhinge87802 жыл бұрын

    Akshay, are you kidding me already crossed 100k. Congrats 👏. You are passionate teacher. ❤

  • @akshaymarch7

    @akshaymarch7

    2 жыл бұрын

    Thank you so much brother, it was not possible without your love and support! ❤️

  • @akshaybhinge8780

    @akshaybhinge8780

    2 жыл бұрын

    @@akshaymarch7 Home work const users = [ { firstName:"akshay", lastName:"bhinge", age:26 }, { firstName:"donald", lastName:"trump", age:75 }, { firstName:"elon", lastName:"musk", age:50 }, { firstName:"deeika", lastName:"padukone", age:29 }, ]; const output = users.reduce(function (acc, curr){ if(curr.age acc.push(curr.firstName); } return acc; }, [ ] ); console.log(output);

  • @bedprakashkushwaha8047
    @bedprakashkushwaha80472 жыл бұрын

    ultimate no one can do better than this.

  • @saicharan4081
    @saicharan40815 ай бұрын

    This is the first video i have seen in your channels. I just printed this topics in my mind . Thank you boss .

  • @avdhootjadhav6705
    @avdhootjadhav6705 Жыл бұрын

    If someone wants to learn these methods, I would definitely refer this one video. Great video 👍

  • @timepass336
    @timepass3362 жыл бұрын

    const output = arr.reduce((acc, curr) => { if (curr.age acc.push(curr.firstName); } return acc; }, []); Thank you for your videos. I do learn a lot!

  • @hamzaakbar5321
    @hamzaakbar53212 жыл бұрын

    @Akshay Saini sir assignment done const output = user.reduce((acc, curr) => { if(curr.age acc.push(curr.name); } return acc; }, []); console.log(output)

  • @mohit96nain

    @mohit96nain

    2 жыл бұрын

    Nice 💯. Also you can use spread operator instead of push 😊

  • @puneetbajaj9927

    @puneetbajaj9927

    2 жыл бұрын

    @@omkaranku1981 you can try acc=[...acc,curr.name] . Spread arr elements first and then the next argument should be the element you want to add.

  • @avadhoot05

    @avadhoot05

    2 жыл бұрын

    @@mohit96nain but spread operator will create a deep copy everytime so its better to use .push()

  • @akhilsingh52as

    @akhilsingh52as

    2 жыл бұрын

    @@omkaranku1981 const output = users.reduce((acc, user) => { if (user.age }, []);

  • @Facts_Agenda
    @Facts_Agenda2 ай бұрын

    Hello Akshay Sir, I watched your whole playlist and its covered my JS is top level. Thanku Sir this top notch content.

  • @Samofficial389
    @Samofficial38911 күн бұрын

    No Words for this content just Asowme , Today I got clarity about map(), filter(), reduce() # Take Inputs = arr const res = arr.reduce((acc, curr) => { if (curr.age > 20) { acc.push(curr.name) } return acc }, []) console.log(res)

  • @sanchitjaiswal666
    @sanchitjaiswal6662 жыл бұрын

    I would love to see object oriented classes in JavaScript and es6 modules as well

  • @AnkitaSharma-wi3jb

    @AnkitaSharma-wi3jb

    2 жыл бұрын

    I second that, waiting for the same.

  • @nitingupta1650
    @nitingupta16502 жыл бұрын

    We can do something like this to get the desired output! const filterByAge = users.reduce((acc,item)=>{ if(item.age>30){ acc.push(item.firstName); } return acc },[])

  • @pranavparashar7137

    @pranavparashar7137

    2 жыл бұрын

    but it would be good to use filter here

  • @nitingupta1650

    @nitingupta1650

    2 жыл бұрын

    @@pranavparashar7137 surely, but that's not the point. The point is whether or not can we achieve the same functionality with reduce.

  • @vishnuvnair756

    @vishnuvnair756

    2 жыл бұрын

    @@vinothkumarv9722 I love how you are trying to say you like Akshay more even when Deepika is having a crush on you✌

  • @divyansh50

    @divyansh50

    2 жыл бұрын

    bro you can replace the if statement with this- item.age>30 ? acc.push(item.firstName) : " "; return acc ONE LINE OF CODE RIGHT !!!

  • @vinothkumarv9722

    @vinothkumarv9722

    2 жыл бұрын

    @@divyansh50 sure we. Can do lie this condition rendering as well 😍

  • @saadhya98
    @saadhya98 Жыл бұрын

    Hi , thanks for clarity on such concepts const res = users.reduce((acc, curr) => { if (curr.age acc.push(curr.name); } return acc; }, []); console.log(res);

  • @girishbhargava6367
    @girishbhargava636717 күн бұрын

    Superb explanation console.log(final) ; const array = users.reduce( function(arr , user){ if(user.age arr.push(user.firstName) ; } return arr ; } , [] ) ; console.log(array) ; Thanks for this amazing video.

  • @ayoobsaad
    @ayoobsaad2 жыл бұрын

    let arr = [{fname: "first",age: 15}, {fname: "second",age:31}]; let output = arr.reduce((acc,curr)=>{ if(curr.age > 30){ acc.push(curr.fname) } return acc },[]); console.log(output);

  • @vinothkumarv9722

    @vinothkumarv9722

    2 жыл бұрын

    Hi Akshay after submitted my answered then i am coming to others how they are answered

  • @inderpreetsingh4176
    @inderpreetsingh4176Ай бұрын

    I am addicted to the way you teach and changed the way, I used to learn. Now, I always hunt the blogs which go in-depth. Here is my H/W // find people whose age is less than 30 using reduce const users = [ {firstName: "Inderpreet", lastname:"singh", age:31}, {firstName: "Rahul", lastname:"Kumar", age:28}, {firstName: "Akshay", lastname:"Saini", age:20} ]; const output = users.reduce(function(acc, curr) { if(curr.age

  • @namratasanger5921
    @namratasanger59212 жыл бұрын

    Akshay Sir, it's commendable that you are sharing the knowledge with everyone. You are an inspiration for all of us. Btw I did the homework. let data = users.reduce((acc,personDetails)=>{ if(personDetails.age return acc; },[]);

  • @prashantlalwani527
    @prashantlalwani52711 ай бұрын

    finally completed yhe whole playlist. Thanks Akshay for the great content.

  • @atharvathombre7438
    @atharvathombre74382 жыл бұрын

    Homework : const output = users.reduce((acc, curr) => { if(curr.age acc.push(curr.firstName); } return acc; }, []);

  • @husler7424
    @husler74242 жыл бұрын

    Request: Next videos on JAVASCRIPT OOPS concepts please 🙏

  • @nextleveltech267
    @nextleveltech2672 ай бұрын

    Sir your contents are soooooooooo useful. It's really helped me to clearly understand map,reduce and filter thoroughly... Lot of love and Thank you ❤️❤️❤️

  • @AsifDawood
    @AsifDawood Жыл бұрын

    Great Video. The concepts of map,filter and reduce were clearly explained with real world requirements

  • @nitingupta1650
    @nitingupta16502 жыл бұрын

    when will you release a video on the 'This' keyword in JS. We really need to understand how the binding of "this" is different in the arrow function !! BTW, great work till now!

  • @akshaybhinge19

    @akshaybhinge19

    2 жыл бұрын

    🙌 I am also waiting for that.

  • @ashishchopra353
    @ashishchopra3532 жыл бұрын

    Thank you for such a nice content. Really clarified all my doubts with simple and advance examples. Home work completed sir. :) const output = users.reduce((acc, curr) => { if (curr.age acc.push(curr.firstName); } return acc; }, []); console.log(output); @Akshay Saini, Can we expect videos on `Iterators` and `generators` in JS in near future ?

  • @saurabhgandhi615

    @saurabhgandhi615

    2 жыл бұрын

    const output = users.reduce((acc, curr) => { if (curr.age && curr.age acc.push(curr.firstName); } return acc; }, []); console.log(output);

  • @shubhanshusahuu

    @shubhanshusahuu

    2 жыл бұрын

    Nice

  • @mohdumar5698

    @mohdumar5698

    2 жыл бұрын

    const names = arr.reduce(function(acc, curr) { if(curr.age return acc },[]) console.log(names)

  • @mohammedshanshajahan4357

    @mohammedshanshajahan4357

    Жыл бұрын

    @@saurabhgandhi615 what is thelogic of curr.age&&

  • @ediagbonyaaiyudubie1097
    @ediagbonyaaiyudubie1097 Жыл бұрын

    all your videos are eye opening for me. i have learnt a lot. god bless you. you are my mentor.

  • @dewanshpal7840
    @dewanshpal78409 ай бұрын

    Thanks for explaining the javascript in so detail H.W const output = users.reduce((acc,curr) =>{if(curr.age console.log(output);

  • @jaynilgaglani9480
    @jaynilgaglani94802 жыл бұрын

    Here's my solution using reduce const output = users.reduce((result, {age, firstName}) => { if(age result.push(firstName); } return result; }, []);

  • @chinmayhegde2506
    @chinmayhegde25062 жыл бұрын

    Your statement "Filter function is actually used to filter" coincided with the Ad that starts with "So you wanna be a Software Engineer at Google".

  • @santhosh_ravi

    @santhosh_ravi

    2 жыл бұрын

    lol

  • @smileysmiley7689
    @smileysmiley7689 Жыл бұрын

    Hi Akshay, As you asked about writing a program using reduce, Here it is :- const output = users.reduce(function (acc, curr){ if (curr.age acc.push(curr.firstName); } return acc; }, []) console.log(output);

  • @meghnakhound8042
    @meghnakhound80423 ай бұрын

    reduce never felt so easy. Thank you!

Келесі