DEV Community

Discussion on: Put Down the Destructuring Hammer

Collapse
aymericbouzy profile image
Aymeric Bouzy

you can even have a "bug" because of destructuring:

const bob = {
  name: "Bob",
  getName() {
    return this.name;
  },
};

bob.getName(); // "Bob"

const { getName } = bob;
getName(); // undefined
Enter fullscreen mode Exit fullscreen mode