Destructure object using rest

March 19, 2021 1 min read
const profile = {
  name: "Telmo",
  age: 33,
  twitter: "@telmo",
  codingSince: 2007
}

const { age, twitter, ...rest } = profile

age // 33
twitter // @telmo
rest // { name: "Telmo", codingSince: 2007 }