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

Chuyển đổi thời gian trong javascript

Sử dụng Object.entries(), Array.prototype.filter() và Array.prototype.map(). Trả về định dạng ngày, giờ, phút với một miliseconds đã cho.

Await in a for loop

How to Await in a for loop

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

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

Remove array of objects from another array of objects

Remove array of objects from another array of objects

flatMap()

Use flatMap() creates a new array with sub-array elements flattened by specified depth.