Splendid UI
Components and utilities for the modern web
-->
ObjectForEach
lets you iterate over an object — by converting it into an array then iterating over that array.
First, make sure you install Splendid UI.
npm install splendid-ui
Then import objectForEach
into your project.
import { objectForEach } from 'splendid-ui/utils'
objectForEach
takes in two arguments:
object
to loop overcallback
to executeobjectForEach(object, ({ key, value }) => {
// Do what you want
})
That’s it!