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

try/catch es10

An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.

Ajax, call jQuery POST to node.js expressjs

Ajax, call jQuery POST to node.js expressjs

Promise + gì

promise + gì

Lấy ngày hiện tại trong javascript

Lấy ngày hiện tại trong javascript

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ư: