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

Object.fromEntries

Object.fromEntries Là một phương thức mới được giới thiệu trong ES10 được sử dụng để chuyển đổi từ list có dạng key và value thành những objects.

kiểm tra email trong javascript

kiểm tra email trong javascript

encode/decode base64 with JS

Encoding to base64 is done with the btoa command

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

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

Random String

Random String với độ dài tuỳ chọn