Components and utilities for the modern web
Javascript Utilities

ObjectForEach

ObjectForEach lets you iterate over an object — by converting it into an array then iterating over that array.

Installation

First, make sure you install Splendid UI.

npm install splendid-ui

Then import objectForEach into your project.

import { objectForEach } from 'splendid-ui/utils'

Usage

objectForEach takes in two arguments:

  • the object to loop over
  • the callback to execute
objectForEach(object, ({ key, value }) => {
  // Do what you want
})

That’s it!

Like what you're seeing?

I'm on a quest to make web development extremely easy — by building components and utilities that will help all of us build better apps at a much faster pace.

I'd like to send you an update when I release something new in Splendid UI. If you want to be updated, please leave your email address below.

Powered by Buttondown