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.
Sự khác biệt giữa substr và substring
Sự khác biệt giữa substr() và substring() chức năng trong JS là gì?
encode/decode base64 with JS
Encoding to base64 is done with the btoa command
Lấy tháng hiện tại trong javascript
Lấy tháng hiện tại trong javascript
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 .