Rest Operator for Objects

object,tipjs,es6

Now we can use rest on the properties of an Object. It allows us to explicitly extract certain named variables, and assign any uncalled variables into a catchall Object.

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

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

Sự khác biệt giữa substr và substring

Sự khác biệt giữa substr() và substring() chức năng trong JS là gì?

Copy a string to the clipboard

Copy a string to the clipboard. Only works as a result of user action (i.e. inside a click event listener).

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.

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

Extend Object javascript

Extend Object javascript