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

Await in a for loop

How to Await in a for loop

group by property javascript use reduce

group by property javascript use reduce

Extend Object javascript

Extend Object javascript

How to reverse an Array?

Reversing an array in JS is really simple with the standard array method. Like below

Callback in javascript

Callback in javascript