JavaScript Asynchronous Programming with JavaScript Exploring Async/Await Convert Promise Handling to Async/Await

Colton Shaw
Colton Shaw
11,929 Points

Thought on a modification for readability.

I notice that to add a value to an object we return the object with {...profileJSON}. Maybe it's me, but this seems difficult to scale & fully read.

What is the downside of modifying this to read like the below? This adds a key/value pair to our object created.

    profileJSON["craft"] = craft;
    return profileJSON;