Complete the code to declare an async function named fetchData.
async function [1]() { return 'data'; }
The function name should be fetchData as requested.
Complete the code to declare an async arrow function assigned to fetchData.
const fetchData = [1] () => { return 'data'; };
await instead of async before the arrow function.function keyword inside arrow function declaration.The async keyword should come before the parentheses in an arrow function.
Fix the error in the async function declaration by completing the code.
async [1] fetchData() { return 'data'; }
function keyword after async.const or let incorrectly.The correct syntax for declaring an async function is async function fetchData().
Complete the code to create an async function expression assigned to fetchData.
const fetchData = [1] function () { return 'data'; };
The async keyword comes before the function keyword, and there is a space (empty string) between function and parentheses.
Fill all three blanks to create an async method inside an object named api.
const api = {
[1]: async function() {
return [2];
},
[3]() {
return 'sync';
}
};The async method is named asyncMethod, it returns 'async data', and the synchronous method is named syncMethod.