Open utterances-bot opened 3 years ago
hi Dmitri, great post as always. I'd say that a built in function that could replicate your higher order function calculate() is the Array.reduce function.
Thanks for sharing!
Hi Dimitri, Brief and to the point article. Btw is there a typo (missing invocation parentheses) below code?
doubles; // [2, 4, 8]
// it should be doubles()
Regards
hi Dmitri, great post as always. I'd say that a built in function that could replicate your higher order function calculate() is the Array.reduce function.
Thanks for sharing!
Hi @santi-diazl! Thanks!
You're right, calculate()
is similar to array.reduce()
.
Hi Dimitri, Brief and to the point article. Btw is there a typo (missing invocation parentheses) below code?
doubles; // [2, 4, 8] // it should be doubles()
Regards
Thanks @me-tasosman! The typo has been fixed.
Great Article. Thanks for writing this simple and effective post. It gave me a good clarity about higher order function.
Great Article. Thanks for writing this simple and effective post. It gave me a good clarity about higher order function.
That's great @vipinc007!
Great explanation Dmitri. calculate
function could be written with reduce
method. Good luck 💪
Great explanation Dmitri.
calculate
function could be written withreduce
method. Good luck muscle
Thanks @AliN11. Yes, calculate
is equivalent to array.reduce
.
Чувак, ты крут, спасибо) Хорошо и просто пишешь) Можешь еще про Компоненты высшего порядка рассказать? и про карирование)
Nice write-up Dmitri. I read all your blog posts and always come out having learned something new. Keep up the good work.
Nice write-up Dmitri. I read all your blog posts and always come out having learned something new. Keep up the good work.
Thanks @stephen-oconnor! I'm glad you're always learning something new from my posts.
Hi! Thank you for your work :) I guess, in line "So, in JavaScript a function can be either first-order or high-order" it is better to use "higher-order" definition, not "high-order".
Hi! Thank you for your work :) I guess, in line "So, in JavaScript a function can be either first-order or high-order" it is better to use "higher-order" definition, not "high-order".
Thanks @ses3332002! You're right about "high-order" — I made a fix.
Hi, Thank you for this great post, the calculator example makes me a little understand what HOF is. Could you give more example about C, return functions from functions? I couldn't figure out what context will use it? Thank you very much.
What are Higher-Order Functions in JavaScript?
The higher-order function accept as arguments or return other functions.
https://dmitripavlutin.com/javascript-higher-order-functions/