ES6 Tutorial #8: map, reduce and filter| Interview Question| Modern Javascript 2021

Sdílet
Vložit
  • čas přidán 2. 07. 2024
  • map, filter and reduce are the most important Higher Order functions in javascript that works with Array to modified or transform your data.
    I have explained these methods with basic to advance examples. Please watch the video till the end to get the best out of it. There is one problem solving assignment at the end for you :)
    Please support my channel,🙏 by showing your love❤️ by liking and sharing my video, so that I can reach to more people and can help them too.
    00:00 - Introduction
    00:50 - Array.map()
    09:25 - Array.filter()
    13:38 - Array.reduce()
    19:08 - Complex example(combing map, reduce and filter)
    24:20 - Method chaining
    25:55: Assignment
    26:20: Thanks for watching 🙏
    Watch my Angular playlist :
    Angular : • Introduction- Angular ...
    Follow me:
    Facebook: / angularjs4beginners
    LinkedIn: / nisha-singla-82407aa0
    Instagram : / passion4code
    For more such interesting videos, please subscribe to my channel and stay connected.
    #javascript #NishaSingla

Komentáře • 42

  • @asif1318
    @asif1318 Před 2 lety +12

    Hey, here is the Assignment:
    const totalScoreRating = emply.reduce((acc, value)=> {
    if(value.title === 'Senior Developer'){
    acc += value.rating1 + value.rating2;
    }
    return acc;
    },0);
    console.log(totalScoreRating);

  • @vasanthapandiyanm2405
    @vasanthapandiyanm2405 Před 2 lety +7

    Put videos about closure, function currying, call, apply, bind...

  • @NishaSingla
    @NishaSingla  Před 2 lety +3

    Watch complete Playlist on javascript here: czcams.com/play/PLC8OkhrVTHNFzxNVvdtCmTw5OSYs4wv5H.html
    Do let me know how you found this video? I read all the comments, would love to hear your feedback! ❤️

  • @sahilkhurana5935
    @sahilkhurana5935 Před 2 lety +7

    You are one of the best teachers!! Thank you for these amazing videos 👍

  • @technostacks682
    @technostacks682 Před 2 lety +3

    Watching you content i cracked top 5 mnc interview in angular and javascript. Thanks

    • @NishaSingla
      @NishaSingla  Před 2 lety +3

      This comment means a lot 🙏🙏
      Really happy to know that I am able to help someone 😀😀

  • @monikasingla1339
    @monikasingla1339 Před 2 lety +3

    👍

  • @tuktuk00794
    @tuktuk00794 Před rokem

    wahhhh mam kya explain kiya hai apne.......very good explanation , especially reduce()😊😍🥰

  • @unemployedcse3514
    @unemployedcse3514 Před 2 lety

    Awesome ❤️

  • @user-iz8du7vr4p
    @user-iz8du7vr4p Před 10 měsíci

    Best

  • @avinashkumar8306
    @avinashkumar8306 Před 2 lety

    Helpful!

  • @samarscript5824
    @samarscript5824 Před rokem +1

    26:17 Assignment .
    const total = employees.reduce((accumlator, value) => {
    value.profile ==="Senior Developer"?accumlator += value.rating1 + value.rating2: accumlator;
    return accumlator;
    }, 0);

  • @RahulYadav-nw3on
    @RahulYadav-nw3on Před 2 lety +2

    Hello nisha thanks for all the videos they are clear and simple no beating around the bush straight to the point videos !! I request you to please make video on reactive forms and template driven forms .. TIA !

    • @NishaSingla
      @NishaSingla  Před 2 lety

      Thank you so much 😊.. sure will update soon 👍🏻

  • @riteshmehta2292
    @riteshmehta2292 Před rokem +1

    Hi Nisha, Thanks for sharing such a wonderful videos . Because of your tutorials, today I am able to read my company code like a text book. You boost my confidence.

    • @NishaSingla
      @NishaSingla  Před rokem

      Thanks Ritesh.
      Really glad to know about this 😀😀 wish you good luck 🤞🏻

  • @shivugg
    @shivugg Před rokem

    Thank you so much Teacher 🙏

  • @snehasingla
    @snehasingla Před 2 lety +3

    👍👍👍

  • @gtmgtm8888
    @gtmgtm8888 Před rokem

    Super mam big applause

  • @sajithashankar4825
    @sajithashankar4825 Před 2 lety +2

    Hi Nisha, you are gifted with explaining concepts so clearly that I get hooked onto your tutorials. Thank you!

    • @NishaSingla
      @NishaSingla  Před 2 lety +2

      Thanks… good to know u found it useful🙏

  • @kashimallarajesh4135
    @kashimallarajesh4135 Před 2 lety +1

    Can you make vedio on jwt authentication and authorization in angular

  • @MuhammadAdnan2.0
    @MuhammadAdnan2.0 Před 2 lety +1

    Well done keep upload js interview questions...

  • @RizwanShaikh-lq5yj
    @RizwanShaikh-lq5yj Před 10 měsíci

    Mam your video is very awesome can you make like ecommerce website videos

  • @WorldVlogsandEntertinment

    Thanks Nisha, Please try to do all videos in JavaScript

  • @lexyching3212
    @lexyching3212 Před 10 měsíci

    which method of evaluation is faster between logical operator and ternary operator

  • @sangameshwarvatte314
    @sangameshwarvatte314 Před rokem

    Hey Nisha thanks for these amazing videos on JS. I hope you will create more videos on js angular. Thank you so much!

  • @ajaykumar-ho4wz
    @ajaykumar-ho4wz Před 7 měsíci

    const result = employees.reduce((acc, emp) => {
    if(emp.profile === 'Senior doveloper') {
    let output = emp.rating1 + emp.rating2;
    acc = acc + output;
    }
    return acc;
    }, 0);
    console.log(result);

  • @aayush5474
    @aayush5474 Před 2 lety

    Mam can you upload videos on spring boot as well?

    • @NishaSingla
      @NishaSingla  Před 2 lety +2

      For that I need to learn spring boot first 😬😬

  • @hajarathbabu4200
    @hajarathbabu4200 Před 2 lety +1

    What is higher order functions?

    • @NishaSingla
      @NishaSingla  Před 2 lety

      Will upload video on that .. stay connected 😃

    • @amitq7000
      @amitq7000 Před 2 lety +1

      High order function is a function which accept function as an argument and/or return function

    • @NishaSingla
      @NishaSingla  Před 2 lety

      Thanks Amit
      You can watch the video on higher order function here
      czcams.com/video/BwyFLRVYbvU/video.html

  • @harika218
    @harika218 Před rokem

    Hi, Here is my assignment
    let totalValue = employees.reduce((acc, emp) => {
    if(emp.role == "Senior Developer"){
    acc += (emp.rating1 + emp.rating2)/2
    }
    return acc;
    }, 0)
    console.log(`Reduce Operator => ${totalValue}`);

  • @chanduBoddu
    @chanduBoddu Před rokem +1

    const TotalRating= employes.reduce((acc, val) => {
    return (val.role === 'SE' && val.rating1 + val.rating2) + acc;
    },0);
    console.log("Total Rating !",TotalRating);

  • @FactuallyConnected
    @FactuallyConnected Před rokem

    The solution of the assignment:
    Sum up the ratings of all the Senior Developer only using reduce method:
    const employee = [
    {id:101, name: "ashish", profile: "Senior Developer", rating1:5, rating2:10},
    {id:102, name: "ashok", profile: "Junior Developer", rating1:6, rating2:10},
    {id:103, name: "aman", profile: "Senior Developer",rating1:7,rating2:7},
    {id:104,name:"ashu",profile:"Senior Developer",rating1:8,rating2:7},
    {id:105,name:"anjan",profile:"Junior Developer",rating1:9,rating2:10},
    ];
    const seniorCount = employee.reduce((acc, curr)=>{
    if(curr.profile === "Senior Developer"){
    acc += curr.rating1 + curr.rating2;
    }
    return acc;
    },0);
    console.log(seniorCount);
    Using map, reduce and filter method :
    const seniorCount = employee.filter((item)=> item.profile == "Senior Developer").map((x)=>x.rating1 + x.rating2).reduce((x,y)=>x+y,0);
    console.log(seniorCount);