Removing fields from objects~ Implementations ~

Removing fields from objects

Earlier in this book, we learned about the destructing assignment. An interesting use case of this feature is that it allows us to remove a field from an object.

function allButPoints(obj) {
  const { points, } = obj;
  return rest;

const user = {
  firstName: "David",
  lastName: "Bird",
  points: 231,
// { firstName: 'David', lastName: 'Bird' }

I use that a lot in the world of React, where a component receives a bunch of props, but I need to pass down just a few of them.