Object.assign works well for copying properties from one object to another. However, we sometimes want to perform other operations based on the properties of an object. This recipe shows how to use Object.entries to get an iterable of an object's properties.
Using Object.entries to get iterable property-name pairs
Getting ready
This recipe assumes you already have a workspace that allows you to create and run ES modules in your browser. If you don't, please see the first two chapters.
How to do it...
- Open your command-line application and navigate to your workspace...