-
Which keyword is used to make the function to be executed asynchronously?
- async
- await
- promise
- callback
-
What is the difference between synchronous and asynchronous programming?
- Synchronous programming is executed in a single thread, while asynchronous programming is executed in multiple threads.
- Synchronous programming is executed in multiple threads, while asynchronous programming is executed in a single thread.
- Synchronous programming is executed in a single thread, while asynchronous programming is executed in a single thread.
- Synchronous programming is executed in multiple threads, while asynchronous programming is executed in multiple threads.
-
What is the difference between callback function and promise?
- Callback function is executed immediately after the function is called, while promise is executed asynchronously.
- Callback function is executed asynchronously, while promise is executed immediately after the function is called.
- Callback function is executed immediately after the function is called, while promise is executed immediately after the function is called.
- Both callbacks function and promise are executed asynchronously.
-
What are complete structure of a promise?
- The promise object has three states: pending, fulfilled, and rejected.
- The promise object has two methods: then and catch.
- The promise object has one method: resolve.
- The promise object has one method: reject.
-
The keyword in error handler which is used to handle errors in a program is?
- catch
- finally
- then
- reject
- JavaScript is a single threaded language.
- Async function is a function that can be paused and resumed.
- Await is used to wait for a promise.
- A promise is an object that represents an operation that hasn't completed yet.
- Error handling is a process of handling errors in a program.
- Callback function is a function that is passed as an argument to another function.
- If a function returns a promise, it is considered asynchronous.
- A promise has three states: pending, fulfilled, and rejected.
- If a promise is resolved, the error handling will be executed.
- A promise can not be resolved or rejected.
- A promise can not be chained.
- If the function uses keyword await, it is considered asynchronous, which need to add async keyword.
- Error Handling
- Callback Function
- Promise
- Async
- Await
- What is the difference between synchronous and asynchronous programming?
- What is the difference between callback function and promise?
- What are complete structure of a promise?
- What are the relationships between async and await?
- What are complete structure of error handling?