Just what i'm looking for. Great work. I'm a looooonnnnng time SQL programmer and new to javascript (which is my new retirement hobby). I was always wondering how in javascript to do a simple "Select EyeColour, count(*) from Characters group by EyeColor". This has opened my eyes! (Which are blue by the way if you need to add that to the data set. 😁)
@drkgumby3 жыл бұрын
Excellent video. Suggestion 1: Turn off vs code intellisense so the popup does not cover your code. Suggestion 2: Put the terminal on the right Suggestion 3: run 'nodemon worksheet.js -q' to hide nodemon status and clean up the console
@KieCodes4 жыл бұрын
5 minutes well spent. Great video. Concepts from functional programmers should be in every developer's toolbox! Thank you for making this! 🙏
@dlongodesign70263 жыл бұрын
The best video I found with Reduce() examples. THANK YOU SO MUCH!!
@JamesQQuick3 жыл бұрын
Yayy!
@my_j.a.r.v.i.s.4 жыл бұрын
Thanks for making these short videos. They're very helpful.
@sateeshnaidu9003 жыл бұрын
Hi James Q Quick , your tutorials are simply awesome, In reduce function example the output of totalMass producing incorrect result(0497784136) , we have to apply parseInt to curr.mass i.e characters.reduce((acc, cur) => acc + parseInt(cur.mass),0). so that we will get correct result(346). Thanks for your Great Tutorials.
@milburngomes73723 жыл бұрын
Helpful, thanks!
@hawkeye904 Жыл бұрын
parseInt() or Number()
@amandoktorcanimkuzumdoktor5193 Жыл бұрын
Thank you man, I was struggling with that number.
@ayodejijoseph68643 жыл бұрын
I wonder the people giving thumbs down for this lovely easy to understand video 🤔, can we see something better from you lots giving thumbs down then.
@JamesQQuick3 жыл бұрын
Lol thanks for the support!
@bradpeters95112 жыл бұрын
I gave you a thumbs up. The video is mostly clear. I wish you would have explained why you started with an empty object. With that being said I have seen several examples of using the reduce method with objects and this is one of the more clear explanations even though I do not understand why you start with an empty object.
@chubbyBunny943 жыл бұрын
Back again for a refresher; by far the most extensive tutorial on this topic
@JamesQQuick3 жыл бұрын
Yasssss!!!
@JimKernix2 жыл бұрын
This and the map vieo were helpful - thanks! I forgot to sub to your channel when I saw your video on Brad Traversy's channel.
@MYount4 жыл бұрын
Thank you for explaining this so clearly and concisely.
@JamesQQuick4 жыл бұрын
Glad you enjoyed it!
@RhoTrepaan3 жыл бұрын
This was quicker than ‘looking it up’ thanks 👍
@robinstahlwarelius18452 жыл бұрын
Great videos! Thx man :) PS color theme do you use?
@GabrielMazzoleni3 жыл бұрын
The eye color example was really good, thanks
@kirilvedmidskiy3 жыл бұрын
if you downloaded array from github, you should convert mass from string to number for it to work: +acc + +cur.mass
@aaronlinton-chambers4 жыл бұрын
I love the way your simplify difficult topics in a manageable way
@jaydenmoon11653 жыл бұрын
First time watching your vids - this was an easy sub for me - really love your vids and explanations - it has been helpful - thank you
@davidjohansson23723 жыл бұрын
Great series on the JS array methods, thanks!
@mocococo28772 жыл бұрын
Greetings from Bulgaria. Thank you for your time and efforts to put those wonderful tutorials. Please, tell me in the case of eye colors, how that object got miraculously arranged into those exact key value pairs, since nowhere you specified that ? Thank you.
@ianhancock34142 жыл бұрын
Flawless explanations! thank you
@DhanByCode4 жыл бұрын
My English is not very good but I really understand it with your explanation, I like your style in explaining and the font used is quite pleasing to the eye with an explanation and a font size that is very suitable and comfortable to see and hear, awesome .. I hope you explain more in detail like this and more tutorials about javascript on your channel cz this tutorial is great!
@JamesQQuick4 жыл бұрын
So glad to hear that :)
@NathanielMujesia Жыл бұрын
🤯🥳🥳🥳 eye color example ,and yes am a beginner
@theoglossa3 жыл бұрын
Great stuff! I'll always go back to this playlist!
@IkraamDev4 жыл бұрын
I remember back in August I couldn't get my head around this.
@JamesQQuick4 жыл бұрын
Is it making more sense now? :)
@IkraamDev4 жыл бұрын
@@JamesQQuick Yes, I fully understand the Array functions after going on Codewars!
@tripvida2 жыл бұрын
Well explained thanks.
@haroldlittlejohn43078 ай бұрын
Thank you so much sir💯
@phickman78724 жыл бұрын
Yet another awesome video!! Love the explanations because they are so easy to follow.
@snapdeus Жыл бұрын
nice, the biggest "aha" moment for me was realizing you can set the initial value to be an empty object
@nested93012 жыл бұрын
how can i find more challenges ? thank you!
@henrikschmidt81783 жыл бұрын
is there a reasone not to use syntax like: arr["index"] = (arr["index"]||0) +1; to handle initialization of unused indexes to skip the if else?
@ravitejadesai3 жыл бұрын
You can. But not easily readable.
@NavilRodrigues3 жыл бұрын
Wow! Thanks a ton. Can you please make a video on how you've customized your VS code and zsh?
@JamesQQuick3 жыл бұрын
I’ve got a video covering vs code. Terminal comes from the command line power user course by Wes bos
@olivierdeplanques7084 жыл бұрын
Very interesting, good video, thanks a lot
@dand44853 жыл бұрын
Ditto.... Sorry to sound like a broken record. But another great video ;)
@shubhsagar62344 жыл бұрын
thank you so much but i have a doubt , instead of ""curr.mass'" can we write it using destructuring if yes then how?
@JamesQQuick4 жыл бұрын
Sure. const {mass}= cur;
@glitchedbyte7474 жыл бұрын
Thanks. I'd like to see more advanced stuff in js :D
@JamesQQuick4 жыл бұрын
Any specific suggestions?
@majdeddinebentahar54344 жыл бұрын
@@JamesQQuick closures maybe??
@JamesQQuick4 жыл бұрын
@@majdeddinebentahar5434 Ooooh that's a tricky one. I'll think about that one! lol
@doniaelfouly4142 Жыл бұрын
Thanks
@driftwood132 жыл бұрын
Can you show how to sort an array of strings case sensitive? e.g. Luke, leila, Darth, yoda
@TheNamesJT3 жыл бұрын
I don't understand the eye color " if (acc[color]) " this if statement checks if color exists right? I don't understand how it decides to count the same color and don't understand the false statement either if color doesn't exist then you set color to true? this if statement is confusing.
@emediongidemeto Жыл бұрын
What's the name of your font sir?
@KaoutharMoragues Жыл бұрын
do u have an explanation for react plz??
@mitchell42173 жыл бұрын
Wondering if you can return values as arrays and don't return duplicates: { eye_color: ["brown","blue","green"] }
@daytonmux3 жыл бұрын
Should be simple enough. Would be easiest/fastest to just use a set that stores colors as the accumulator, but you could do it with an array using similar logic to what he did in the video, just checking the color array in the accumulator and adding the color if it doesn't exist yet
@REET911 Жыл бұрын
Can anyone clarify why acc[cur.eye_color] works but same with dot notation acc.cur.eye_color doesn't work??
@JamesQQuick Жыл бұрын
acc[cur.eye_color] -> something like acc["brown"] so it's getting the value associated with the key of "brown" where as acc.cur.eye_color just becomes the color itself.
@rahmansheikh47814 жыл бұрын
Can you please make video on generators function
@prudhvichinnam14884 жыл бұрын
Please do classes constructor function functions,factoryfunctions
@emediongidemeto Жыл бұрын
What's the name of your theme sir?
@ripplesr56553 жыл бұрын
Hey,i have put every bit of effort to figure out what am i doing wrong, but i am getting this number as total of mass .I have rechecked countless times, i have the exact same code but with different number.
@zenguitarankh2 жыл бұрын
Same....
@ridl273 жыл бұрын
ty
@josesilva26143 жыл бұрын
I just have a problem, my values are concatenate. I try with Math but nothing =(
@uchichaobito6073 жыл бұрын
Use parseInt() or Number() eg: const totalMass = characters.reduce( (acc,curr) => { return parseInt(acc)+ parseInt(curr.mass); },0);
@josesilva26143 жыл бұрын
@@uchichaobito607 Thank you
@ctx42413 жыл бұрын
map and reduce are such bizarrely named functions...
@nathanboeger9783 жыл бұрын
Dude, over 10k views but only 579 likes? That dog won't hunt.
@richcaro31323 жыл бұрын
niced
@TheLuksas3 жыл бұрын
to difficult for me.. :/
@John-nr8vu3 жыл бұрын
Fuck no dislikes yet 🙄😯 is it a sign to hope in humanity again?😁
@JamesQQuick3 жыл бұрын
Hahahah maybe so!
@231-o5m2 жыл бұрын
need more class
@kagishophahlamohlaka23064 жыл бұрын
I LIKE YOU PJ'S!!!!! if they are pj's
@JamesQQuick4 жыл бұрын
Haha not pjs but I appreciate it
@guythesavage29084 жыл бұрын
I was the 69th like, nice
@JamesQQuick4 жыл бұрын
Bahahaha
@chubbyBunny94 Жыл бұрын
Me again, I forgot it all :D
@zenguitarankh2 жыл бұрын
Not sure if maybe something in JS has changed since this video but for totalMass, I kept getting 0771364984 so I knew it was being concatenated as strings so I tried commenting out 'use strict' and also tried taking quotes off the numbers in the characters array but the only fix was wrapping cur.mass in Number() in the return. I'm sure parsint etc probably works too Just incase someone else has this problem and is spinning their wheels.
@kesraouimohamed9611 Жыл бұрын
in the code the typof mass is string, you should use + before curr
@ombhosale80902 жыл бұрын
The Array Worksheet - github.com/jamesqquick/javascript-array-functions-practice
@JamesQQuick2 жыл бұрын
Thanks for grabbing that
@urbanebachelor Жыл бұрын
Theres a great chance that things have changed in the 2 years since this video posted, but when I try to work along, I get a long string of numbers instead of the sum total: const totalMass = characters.reduce((acc, cur) => acc + cur.mass, 0); console.log(totalMass); 0771364984
@JamesQQuick Жыл бұрын
I think that means that one of your inputs is actually a string. Are you sure cur.mass is a number and not a string?