DEV Community

Walktheworld
Walktheworld

Posted on

Key Takeaways From My First JS Project

Asynchronous requests allow our code to multi-task.

A fetch() request has three statuses; Promise, Response, & Error.

-The promise is the HTML API source.

-The Response is the data from the source.

-Error occurs when no response is returned.

An EventListener takes an action ("click", "submit") and a callback function written as arrow function (()=>{}).

Function() should only be used when it is the start of the code otherwise ES6 is standard (i.e arrow function).

Know your data!

When you change one thing make sure you go through and restructure anything else that references that original location where the change was made. I found myself iterating through one object over and over again with a forEach statement, which I had written initially for an API with multiple objects.

Know your code!

Alt Text

Top comments (0)