Coding Train Live 121: map() and reduce() in JavaScript

preview_player
Показать описание
In this live stream, I cover higher order functions in JavaScript and discuss them in the context of arrays: map() and reduce()

Timestamps:
19:04 - Introduction to higher order functions
44:00 - map()
1:09:53 - reduce()

Рекомендации по теме
Комментарии
Автор

Great format! I like how Daniel take a time to think and make a mistakes, makes me feel a bit less stupid programmer. It's also a lot funnier, all that "I'm just gonna enter into the screen again" stuff was hollerious. Love it <3

hatrick
Автор

To generate an array of 100 random numbers you could use

Array.from({length: 100}, math.random)

which is much prettier in my opinion :)

gonengazit
Автор

Friday induces slumber... Normal! :) Great "video"...

circli
Автор

viva lhate / hove javascript! Absolutly!!

Mezklador
Автор

something a tiny bit more advanced but somewhat interesting is that you can implement map using reduce. reduce is the really the granddaddy of the higher order functions. you can implement every other HOF in terms of reduce: map, filter, sort, etc.

also, great explanation of reduce. it took me a while to really wrap my head around it, but you explained the accumulator aspect really well.

ridespirals
Автор

E is the most common letter in English... I'm not sure how well the common lexicon maps to your programming habits.

yaidontknowwhattoput
Автор

Reduce(previous, present)=>((previous>present) ? Previous: present)
Or max(array)

MrGarysjwallace
Автор

why dont you use regular javascript and not p5?

madcorndog
Автор

Hi, when i run processing sketch in processing IDE it runs fine but when try to run it on a browser(chrome) using a local server it throws an error
Cannot read property 'function_name' of null at....
I am tired searching for answers please help

ShubhamSharma-sjcu
Автор

i don't understand what is this channel about? i see only the JavaScript programming stuff...

bibashkatel
join shbcf.ru