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
Merge Array
How to combine two sorted arrays into one? We can do this easily with the spread operator.
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 .
Random String
Random String với độ dài tuỳ chọn
Object.keys và Object.getOwnPropertyNames
Object.keys và Object.getOwnPropertyNames