Javascript Nuggets - Reduce (object example)

  Рет қаралды 33,269

Coding Addict

Coding Addict

3 жыл бұрын

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
@thutanyan1381 2 жыл бұрын
You are the best in React and Javascript. Thanks, Sir for your teaching.
@pitbul67204
@pitbul67204 3 жыл бұрын
Another great JS nugget thanks for all the great tutorials
@eq6P6jW4bM8
@eq6P6jW4bM8 3 жыл бұрын
As always, amazing content, thank you so much! :)
@Shakeel714
@Shakeel714 3 жыл бұрын
Quality series from an awesome teacher to get really confident in web dev topics
@lukaszszmyd8767
@lukaszszmyd8767 2 жыл бұрын
Thank's John, great content
@queerly__coded
@queerly__coded 2 жыл бұрын
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
@anandhinamasu9138
@anandhinamasu9138 9 ай бұрын
Thank you so much Jhon, to make it every topics so easy to grap using real time project example, you are my best coach❤
@likojhyu
@likojhyu 2 жыл бұрын
This vídeo is really good 👍 Reduce's power is amazing, we can implement very interesting tasks. Thank you.
@emekaokonkwo626
@emekaokonkwo626 9 ай бұрын
Man your explanation is stellar.... most examples of reduce are using numbers... this is really helpful sir.. cheers
@PetroCAD
@PetroCAD 26 күн бұрын
You are the best teacher ....
@cesmorf5398
@cesmorf5398 2 жыл бұрын
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
@ozankurucu6261
@ozankurucu6261 2 жыл бұрын
Thank you!!
@jydev8073
@jydev8073 3 жыл бұрын
Waiting for next.js tutorial from Coding Addcit :)
@Auditor1337
@Auditor1337 2 жыл бұрын
This one was so cool, I learnt a ton
@CodingAddict
@CodingAddict 2 жыл бұрын
Thank you!
@lifeisbeautifu1
@lifeisbeautifu1 Жыл бұрын
Thank you❤
@vishant898
@vishant898 3 жыл бұрын
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
@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 :)
@ferhatsunaycansev106
@ferhatsunaycansev106 3 жыл бұрын
perfect videos if we want async await and promise videos maybe they are also unclear : ) thanks again
@RokSlana
@RokSlana Жыл бұрын
Nice!
@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...
@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!
@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)
@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
@askarp6485
@askarp6485 2 жыл бұрын
Thanks sir, it’s a great video, what extension are you using to show the console log output?
@CodingAddict
@CodingAddict 2 жыл бұрын
quokka.js
@olegg1082
@olegg1082 3 жыл бұрын
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)
@AnkitPatel04
@AnkitPatel04 27 күн бұрын
Can you tell me what is this syntax "total[language]" I am confused
@sairfan06
@sairfan06 Ай бұрын
What vscode extension was used here to show result on each row?
@charmz973
@charmz973 3 жыл бұрын
woow!!!
@Fatima-ie5kj
@Fatima-ie5kj 3 жыл бұрын
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
@abelmarkos5753
@abelmarkos5753 3 жыл бұрын
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
@mrkhoros
@mrkhoros 3 жыл бұрын
what extension are you using for the alarts?
@CodingAddict
@CodingAddict 3 жыл бұрын
If you mean console.log - quokka
@brutalv4
@brutalv4 3 жыл бұрын
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"
@ivanyosifov2629
@ivanyosifov2629 3 жыл бұрын
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
@CoderDmitri
@CoderDmitri 3 жыл бұрын
John.... JOHN... Notice MEEEEE! You are MY HERO... !
@relationtips4725
@relationtips4725 3 жыл бұрын
hey what is that const{amount, price} can u explain me to please
@bit.blogger
@bit.blogger 3 жыл бұрын
I get fetch is not defined can you help me?
@khushiujjawal3668
@khushiujjawal3668 3 жыл бұрын
global.fetch = require("node-fetch");
@irsyadrdp
@irsyadrdp 2 жыл бұрын
@@khushiujjawal3668 Thank you !!!
@aliss14
@aliss14 2 жыл бұрын
Man, How didn't I know you earlier ;(
@furyofonethousandgods2926
@furyofonethousandgods2926 2 жыл бұрын
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
@user-ct5oo3do7b
@user-ct5oo3do7b 2 жыл бұрын
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
@SeniorJuniorDeveloper
@SeniorJuniorDeveloper 2 жыл бұрын
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 :)
@spondoolie6450
@spondoolie6450 Жыл бұрын
I came for the tacos and burritos
@Do-qr3jt
@Do-qr3jt Жыл бұрын
Hi, what kind of extension which shows answer ,,, please,,,
@CodingAddict
@CodingAddict Жыл бұрын
quokka.js
@sharku111
@sharku111 2 жыл бұрын
|| 1 ? It is very clever.
@great9640
@great9640 11 ай бұрын
this is a pretty difficult topic for me to grasp
@aatomaszewski
@aatomaszewski 3 жыл бұрын
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
@MultiAlifarooq 3 жыл бұрын
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
Жыл бұрын
Killer language decision: language && (total[language] = total[language] + 1 || 1); //
Javascript Nuggets - Async / Await
16:46
Coding Addict
Рет қаралды 24 М.
Javascript Nuggets -  Promises Example
13:19
Coding Addict
Рет қаралды 18 М.
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 29 МЛН
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 141 МЛН
마시멜로우로 체감되는 요즘 물가
00:20
진영민yeongmin
Рет қаралды 29 МЛН
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 105 МЛН
5 Real Life Examples of Array Reduce in JavaScript
12:47
Learn the JavaScript Reduce function in 18 minutes (for beginners)
18:23
ES2022
8:23
Coding Addict
Рет қаралды 11 М.
Javascript Nuggets - Promises
13:28
Coding Addict
Рет қаралды 24 М.
Javascript Nuggets - Debounce
10:09
Coding Addict
Рет қаралды 6 М.
Reduce: 10 Different Examples. JavaScript Fundamentals.
26:57
Leigh Halliday
Рет қаралды 28 М.
Solving a JavaScript Array Reduce Interview Question
11:27
Wes Bos
Рет қаралды 22 М.
8 Must Know JavaScript Array Methods
10:05
Web Dev Simplified
Рет қаралды 1 МЛН
Javascript Nuggets - Rest Operator
11:30
Coding Addict
Рет қаралды 15 М.
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 29 МЛН