Skip to main content
CSS-Tricks
  • Articles
  • Videos
  • Almanac
  • Newsletter
  • Guides
  • DigitalOcean
  • DO Community
Search

Articles Tagged
reduce

3 Articles
{
,

}
Direct link to the article Getting to Know the useReducer React Hook
beginning react react hooks reduce reducer

Getting to Know the useReducer React Hook

useReducer is one of a handful of React hooks that shipped in React 16.7.0. It accepts a reducer function with the application initial state, returns the current application state, then dispatches a function.

Here is an example of how it …

Avatar of Kingsley Silas
Kingsley Silas on Jun 26, 2019 (Updated on Jul 6, 2019)
Direct link to the article Why Using reduce() to Sequentially Resolve Promises Works
async JavaScript promises reduce

Why Using reduce() to Sequentially Resolve Promises Works

Writing asynchronous JavaScript without using the Promise object is a lot like baking a cake with your eyes closed. It can be done, but it’s gonna be messy and you’ll probably end up burning yourself.

I won’t say it’s necessary…

Avatar of Alex MacArthur
Alex MacArthur on Oct 17, 2018
Direct link to the article Understanding the Almighty Reducer
arrays JavaScript reduce reducer

Understanding the Almighty Reducer

I was recently mentoring someone who had trouble with the .reduce() method in JavaScript. Namely, how you get from this:

const nums = [1, 2, 3]
let value = 0

for (let i = 0; i < nums.length; i++) {
  
…
Avatar of Sarah Drasner
Sarah Drasner on Jun 13, 2018

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • DigitalOcean
  • DigitalOcean Community
  • About DigitalOcean
  • Legal
  • Free Credit Offer
CSS-Tricks
  • Email
  • Guest Writing
  • Book
  • Advertising
Follow
  • Mastodon
  • Twitter
  • Instagram
  • YouTube
  • CodePen
  • iTunes
  • RSS
Back to Top