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

Lodash sort - Test performance with native js

Lodash sort - Bài viết ngắn gọn muốn đưa ra con số sau khi test về Lodash và Native js. Đây chỉ là check trên phương diện cá nhân...

flatMap()

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

Clone Objects in JavaScript

3 Ways to Clone Objects in JavaScript

Làm phẳng mảng dùng phương pháp đệ quy

Làm phẳng mảng dùng phương pháp đệ quy

How to reverse an Array?

Reversing an array in JS is really simple with the standard array method. Like below