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

Random Number javascript

Random Number javascript

Hàm lày ngày trong tuần javascript

Hàm lày ngày trong tuần javascript

group by property javascript use reduce

group by property javascript use reduce

Detect when your site is visible to users

Detect when your site is visible to users

flatMap()

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