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
serialize Form
Sử dụng formdata constructor để convert form, FormData, array.from(). Kết hợp window.encodeURIComponent() để encode từng value trong form.
Đếm có bao nhiêu items giống nhau trong một array
reduce javascript. Đếm có bao nhiêu items giống nhau trong một array
Extend Object javascript
Extend Object javascript
JavaScript: async/await with forEach
JavaScript: async/await with forEach()
Converting Object to an Array
Converting Object to an Array