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

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

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

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

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

encode/decode base64 with JS

Encoding to base64 is done with the btoa command

closure javascript

closure javascript

Làm phẳng mảng dùng phương pháp đệ quy

Làm phẳng mảng dùng phương pháp đệ quy