Spread Operator for Objects

tipjs,function,object,es6

Using the spread operator during an Object declaration will assign the properties of the referenced Object to the new Object.

Tips: 5 ways use spread operator

const moreOptions = {
  text: 'Hello',
  color: 'red'
}
const options = { enabled: true, ...moreOptions }
console.log(options) // { enabled: true, text: 'Hello', color: 'red' }

Có thể bạn đã miss một số snippets code

Promise.all là gì?

Promise.all là gì? Hiểu và sử dụng promise all trong những trường hợp nào trong vòng 1 phút.

serialize Form

Sử dụng formdata constructor để convert form, FormData, array.from(). Kết hợp window.encodeURIComponent() để encode từng value trong form.

Sử dụng reduce và concat làm phẳng một array

Array.reduce() và Array.concat() có thể giúp chúng ta làm phẳng một Array như:

JavaScript: async/await with forEach

JavaScript: async/await with forEach()

kiểm tra email trong javascript

kiểm tra email trong javascript