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

Extend Object javascript

Extend Object javascript

Convert Array-like to True Array

Convert Array-like to True Array

10 mẹo sử dụng array và object trong javascript

10 mẹo sử dụng array và object trong javascript

Ajax, call jQuery POST to node.js expressjs

Ajax, call jQuery POST to node.js expressjs

Calculate the number of difference days between two dates

Calculate the number of difference days between two dates