Javascript Nuggets - Reduce (object example)

Javascript Nuggets - Reduce (object example)
Fusion Charts
www.fusioncharts.com/
Products I Use:
Microphone - Shure SM7B - amzn.to/3fX55aD
Headphones - Shure AONIC 50 - amzn.to/3zbkxHC
Desk-Mounted Microphone Stand - amzn.to/3x3MBuS
Crossover - dbx 234s - amzn.to/3xcryGC
Audio Interface - Focusrite Scarlett 2i2 3rd Gen - amzn.to/3pt1wMx
Cheaper Microphone (My first mic) - Blue Yeti USB Mic amzn.to/3iliwTm
Blue Light Blocking Glasses - amzn.to/3fZASrv
Apple MacBook Pro 13.3" - amzn.to/3z5QDEK
iMac - amzn.to/3glWmOe
Second Monitor - LG 4K UHD 27UD88 - amzn.to/3ckdwdV
Wifi Router - TP-Link AC1900 - amzn.to/34ZSddz
Desk Chair - amzn.to/3ikNbQJ
Standing Desk - amzn.to/3zdKVAJ
Books I Recommend:
The Subtle Art of Not Giving a F*ck - amzn.to/3v9t8Yi
The Tipping Point - amzn.to/3gCslKj
Atomic Habits - amzn.to/3x52xNa
12 Rules for Life - amzn.to/3gln8pN
Deep Work - amzn.to/3cyAgqu
Digital Minimalism - amzn.to/3gao69A
A World Without Email - amzn.to/351Swoe
Rich Dad Poor Dad - amzn.to/3v8RWQ6
Rich Dad's Cashflow Quadrant - amzn.to/3ivt1Uk
Check out My Amazon Store for more products and books recommendations - www.amazon.com/shop/codingaddict
Disclosure: This video is not sponsored. Some links above are affiliate links, and l may earn a small commission from any purchases at no additional cost to you. Thank you for supporting my channel!

Пікірлер: 73

  • @thutanyan1381
    @thutanyan13812 жыл бұрын

    You are the best in React and Javascript. Thanks, Sir for your teaching.

  • @pitbul67204
    @pitbul672043 жыл бұрын

    Another great JS nugget thanks for all the great tutorials

  • @eq6P6jW4bM8
    @eq6P6jW4bM83 жыл бұрын

    As always, amazing content, thank you so much! :)

  • @Shakeel714
    @Shakeel7143 жыл бұрын

    Quality series from an awesome teacher to get really confident in web dev topics

  • @lukaszszmyd8767
    @lukaszszmyd87672 жыл бұрын

    Thank's John, great content

  • @queerly__coded
    @queerly__coded2 жыл бұрын

    Hey thanks for this John. I've been working on a kata for a while trying to figure out how I could use reduce to return only unique values from an array of objects into a new object and even though I had to fandangle this a bit in my logic, your direction gave me the first part of the solution to my puzzle. I got such a rush when my console.log returned what I had hope for. tyvm ~Hope

  • @likojhyu
    @likojhyu2 жыл бұрын

    This vídeo is really good 👍 Reduce's power is amazing, we can implement very interesting tasks. Thank you.

  • @PetroCAD
    @PetroCAD10 күн бұрын

    You are the best teacher ....

  • @anandhinamasu9138
    @anandhinamasu91388 ай бұрын

    Thank you so much Jhon, to make it every topics so easy to grap using real time project example, you are my best coach❤

  • @emekaokonkwo626
    @emekaokonkwo6268 ай бұрын

    Man your explanation is stellar.... most examples of reduce are using numbers... this is really helpful sir.. cheers

  • @Auditor1337
    @Auditor13372 жыл бұрын

    This one was so cool, I learnt a ton

  • @CodingAddict

    @CodingAddict

    2 жыл бұрын

    Thank you!

  • @ozankurucu6261
    @ozankurucu62612 жыл бұрын

    Thank you!!

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

    Thank you❤

  • @jydev8073
    @jydev80733 жыл бұрын

    Waiting for next.js tutorial from Coding Addcit :)

  • @cesmorf5398
    @cesmorf53982 жыл бұрын

    you are a genius in teaching this, believe me, i see many people claiming to be the best course but the transmission method is far behind you

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

    u r my kinda teacher i wanna learn more and more from u thank you

  • @vscodeaddict6607

    @vscodeaddict6607

    Жыл бұрын

    your channel is very under-appreciated.

  • @CodingAddict

    @CodingAddict

    Жыл бұрын

    Oh, well. It is what it is :)

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

    Hello! Thank you for this tutorial. Really useful. I am just wondering how to count number of items and "bundle" them when they are the same increasing amount...

  • @ferhatsunaycansev106
    @ferhatsunaycansev1063 жыл бұрын

    perfect videos if we want async await and promise videos maybe they are also unclear : ) thanks again

  • @vishant898
    @vishant8983 жыл бұрын

    you explain very well .2nd Example is complicated i will be watch again... make videos on slice ,splice and split

  • @christopherak4656

    @christopherak4656

    3 жыл бұрын

    create a small sample of array objects for different languages and go over it again! it works. For the else statement it initialises the value to 1 before the count for the language if has not been counted yet that it why there is an empty object to set all the values to 1 before the count begins

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

    Excellent video!!! I was wondering how you got the console.log() output to show up in your VS CODE?

  • @CodingAddict

    @CodingAddict

    Жыл бұрын

    it's vs code extension called quokka.js (free version)

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

    Nice!

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

    On 10:19 its also possible to use the + operator to convert a string to a number like so +cartTotal.toFixed(2) Great video, thank you (:

  • @CodingAddict

    @CodingAddict

    Жыл бұрын

    Great tip!

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

    Hey man! Thanks for sharing this...also whats that adon that shows in vscode what a function rerurns or console.logs? Thanks

  • @CodingAddict

    @CodingAddict

    Жыл бұрын

    extension quokka.js

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

    What vscode extension was used here to show result on each row?

  • @olegg1082
    @olegg10823 жыл бұрын

    Hi, thanks for another amazing video! Can you maybe clarify what you mean by "dynamic functionality". When you talk about the input array you also said it's not going to be dynamic. Could you explain how dynamic would work? Or do you cover that in some other videos?

  • @CodingAddict

    @CodingAddict

    3 жыл бұрын

    Hi, it means that in this case we have a static value of cart. In react project cart value is changing when we click buttons but the functionality to count the totals is still the same (our function)

  • @Fatima-ie5kj
    @Fatima-ie5kj2 жыл бұрын

    What if i want to get unique object key's from arrays of objects is it possible to do this in reduce method? Kindly guide me thankyou

  • @askarp6485
    @askarp64852 жыл бұрын

    Thanks sir, it’s a great video, what extension are you using to show the console log output?

  • @CodingAddict

    @CodingAddict

    2 жыл бұрын

    quokka.js

  • @AnkitPatel04
    @AnkitPatel0411 күн бұрын

    Can you tell me what is this syntax "total[language]" I am confused

  • @aliss14
    @aliss142 жыл бұрын

    Man, How didn't I know you earlier ;(

  • @charmz973
    @charmz9733 жыл бұрын

    woow!!!

  • @brutalv4
    @brutalv43 жыл бұрын

    Great video! By the way, what's the extension for VS Code that shows the function results? Thank you!

  • @CodingAddict

    @CodingAddict

    3 жыл бұрын

    quokka.js

  • @olegg1082

    @olegg1082

    3 жыл бұрын

    This must be trolling at this point. This question is being asked and answered under literally every video and often multiple times.

  • @brutalv4

    @brutalv4

    3 жыл бұрын

    @@olegg1082 no trolling at all =)

  • @deveighteen6302

    @deveighteen6302

    2 жыл бұрын

    @@olegg1082 you meant "trending" ?

  • @deveighteen6302

    @deveighteen6302

    2 жыл бұрын

    I guess he meant "trending"

  • @abelmarkos5753
    @abelmarkos57533 жыл бұрын

    great video it will be realy amayzing if you could find time to do some back end tuttorial like node.js and mongodb it will help in increasing the coding addict community and i hope the day come when this chaneal hit the 1million subscriber

  • @relationtips4725
    @relationtips47252 жыл бұрын

    hey what is that const{amount, price} can u explain me to please

  • @mrkhoros
    @mrkhoros3 жыл бұрын

    what extension are you using for the alarts?

  • @CodingAddict

    @CodingAddict

    3 жыл бұрын

    If you mean console.log - quokka

  • @ivanyosifov2629
    @ivanyosifov26293 жыл бұрын

    Can we also go over *forEach* in this series just for the sake of completeness?

  • @CodingAddict

    @CodingAddict

    3 жыл бұрын

    Hey Ivan, emm we will see, at the moment I have only one more planned

  • @user-ct5oo3do7b
    @user-ct5oo3do7b2 жыл бұрын

    response.json() / res.json() // Despite the method being named json(), the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. "Parse as JSON" means analyze it in JSON format - but JS is returned

  • @CoderDmitri
    @CoderDmitri3 жыл бұрын

    John.... JOHN... Notice MEEEEE! You are MY HERO... !

  • @furyofonethousandgods2926
    @furyofonethousandgods29262 жыл бұрын

    Hey John, do you know why I keep getting "fetch is not defined in VSCODE". I even copy pasted your code and still says fetch is not defined. It's like I'm missing a package or something but I thought fetch was built in

  • @CodingAddict

    @CodingAddict

    2 жыл бұрын

    It's probably something to do with your settings.

  • @shellbot972

    @shellbot972

    2 жыл бұрын

    got it resolved by installing node-fetch version 2 : npm install node-fetch@2

  • @sharku111
    @sharku1112 жыл бұрын

    || 1 ? It is very clever.

  • @bit.blogger
    @bit.blogger3 жыл бұрын

    I get fetch is not defined can you help me?

  • @khushiujjawal3668

    @khushiujjawal3668

    2 жыл бұрын

    global.fetch = require("node-fetch");

  • @irsyadrdp

    @irsyadrdp

    2 жыл бұрын

    @@khushiujjawal3668 Thank you !!!

  • @Do-qr3jt
    @Do-qr3jt Жыл бұрын

    Hi, what kind of extension which shows answer ,,, please,,,

  • @CodingAddict

    @CodingAddict

    Жыл бұрын

    quokka.js

  • @SeniorJuniorDeveloper
    @SeniorJuniorDeveloper2 жыл бұрын

    When you add parseFloat() at 10:18 it breaks toFixed(2) and makes cartTotal = 5599.9 (line 43): cartTotal = parseFloat(cartTotal.toFixed(2)) But if I do 'cartTotal = parseFloat(cartTotal).toFixed(2)' then cartTotal = 5599.90 in fact, passing any number into parseFloat(cartTotal.toFixed(number)) from 1 - 11 will result in 5599.9, while passing any number greater than 12 will result in 5599.90 Why is that?

  • @CodingAddict

    @CodingAddict

    2 жыл бұрын

    Hmm. I'm really not sure :)

  • @great9640
    @great964011 ай бұрын

    this is a pretty difficult topic for me to grasp

  • @aatomaszewski
    @aatomaszewski3 жыл бұрын

    cart array, just to not rewrite it :) ``` const cart = [ { title: "Samsung Galaxy S7", price: 599.99, ammount: 1 }, { title: "google pixel", price: 499.99, ammount: 2 }, { title: "Xaiomi Redmi Note 2", price: 699.99, ammount: 4 }, { title: "Xaiomi Redmi Note 5", price: 399.99, ammount: 3 }, ]; ```

  • @MultiAlifarooq
    @MultiAlifarooq3 жыл бұрын

    The one who dislike the video will be surely from your family.

  • @CodingAddict

    @CodingAddict

    3 жыл бұрын

    why?

  • @olegg1082

    @olegg1082

    3 жыл бұрын

    What do you mean?

  • @MultiAlifarooq

    @MultiAlifarooq

    3 жыл бұрын

    It was a sarcasm....You will not get because mostly in Asian countries family members like cousin don't appreciate your efforts..I m learning a lot from you...

  • @CodingAddict

    @CodingAddict

    3 жыл бұрын

    Ha ha. Thank you for info

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

    I came for the tacos and burritos

  • Жыл бұрын

    Killer language decision: language && (total[language] = total[language] + 1 || 1); //