Object.fromEntries() allows you to create an object from an array of key-value pairs. The method automatically picks up the arrays as key/value pairs to drop into the resulting object. The resulting userProfile object is shown in the comment at the bottom of the code snippet above.

2m read timeFrom mailchi.mp
Post cover image

Sort: