I have an object that has a method. Inside that method is a function, I want to use my object property inside the function of my method.
this is what I'm doing right now:
const obj ={ property: 5, method(){ //deconstructing this obj const {property} = this; // a function inside a method const func1 = () =>{ console.log(property + 5); } } } I destructured the obj inside its method because I don't want to keep on doing this.property or obj.property when I'm using my obj property inside the function of my method. Is this bad and is there a better way to do this?