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

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

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

So sánh hai array trong javascript

Làm thế nào để đánh giá xem hai mảng có bằng nhau không? Có hai cách đó là sử dụng JSON.stringify() hoặc toString()

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

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

await axios get

await axios get

lỗi access-control-allow-origin và cách khắc phục

lỗi access-control-allow-origin và cách khắc phục trong express, nodejs