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

encode/decode base64 with JS

Encoding to base64 is done with the btoa command

Rolling loading

Nguyên tắc là theo dõi các sự kiện cuộn trang và phân tích mối quan hệ thuộc tính giữa clientHeight , scrollTop và scrollHeight .

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

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

Ajax, call jQuery POST to node.js expressjs

Ajax, call jQuery POST to node.js expressjs

How to reverse an Array?

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