InterviewSolution
| 1. |
Explain Destructuring in ES6? |
|
Answer» ASYNC await help in ALLOWING us to WRITE completely synchronous-looking code while performing asynchronous tasks behind the scenes. Async await are basically promises under the hood. But they have made the code for promises very easier to implement. If promises had simplified the code for callbacks, then async await have simplified the code for promises. We will refactored the code with async await. Here, INSTEAD of three functions we have one function cleaningTheRoom, which have a keyword “async” infront of it. It means that the function will have await statement(s). In the “await” we can have the value returned by a Promise stored in a variable. This type of code is much more CLEANER then promise. |
|