UnderStanding Asynchronous Code, and API's
# UnderStanding Asynchronous Code, and API's
1. What is the difference between asynchronous code and synchronous code?
Synchronous code is run in order, and has to wait. Asyonchronous code jsut runs, without having to wait.
2. What is an event listener?
An event listener is something that watches for a change, and then does something. For example, ProxyState.on("whatever",doThisFunction())
3. What does the O represent in the SOLID principles?
It is the Open/Closed Princible. It means your software should be open extension, but closed to modification.
4. What is a callback / higher order function?
A callback function is a function that saves its value to give to another function at a later time and date. The higher order function is the function that receives the value
5. What is a promise? How do you capture an error from a promise?
A promise is what you are asking from a server. You catch the error for the promise with the Try/Catch.
6. Name three processes used to make requests over HTTP?
You use Get, Delete, and Put
7. What does the API acronym stand for?
It stands for Application Program Interface.
8. In the MVC design pattern, who is responsible for making calls to APIs?
The Axios Service and the Item Service. And then the Async and await and try/catch feature.
9. What is the purpose of encapsulation in programming?
One purpose is for organization. The other is for hiding information.
10. What is HTTP response code for a successful request?
It is something in the 200's. That is the generic answer for successes.
11. What is a 500 error?
It is a generic error. It is for when something went wrong but the computer doesn't know quite what.