Async await in javascript

async,tipjs,function

const fs = require('fs')
async function readFile() {
  try {    
    var f1 = await readFileWithPromise('/etc/passwd')
    console.log(f1.toString())
    var f2 = await readFileWithPromise('/etc/profile')
    console.log(f2.toString())
  } catch (err) {
    console.log(err)
  }
}

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

flatMap()

Use flatMap() creates a new array with sub-array elements flattened by specified depth.

Ajax, call jQuery POST to node.js expressjs

Ajax, call jQuery POST to node.js expressjs

try/catch es10

An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.

Async await in javascript

Async await in javascript

encode/decode base64 with JS

Encoding to base64 is done with the btoa command