using async/await to catch errors

javascript,es6,object,web_development

async function executeAsyncTask () {
  try {
    const valueA = await functionA();
    const valueB = await functionB(valueA);
    const valueC = await functionC(valueB);
    return await functionD(valueC);
  }
  catch (err) {
    logger.error(err);
  } finally {
    await alwaysExecuteThisFunction();
  }
}

Có thể bạn đã miss một số snippets code

Get value select option JavaScript

How do I get the text value of a selected option and get value select option by Jquery.

Promise + gì

promise + gì

parse javascript Example

The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string

Spread Operator for Objects

Using the spread operator during an Object declaration will assign the properties of the referenced Object to the new Object.

10 mẹo sử dụng array và object trong javascript

10 mẹo sử dụng array và object trong javascript