I'm constantly confused whether object destructuring in javascript applies in certain situations, and I've just come across one. In this code I am simply taking properties from the this
object and assigning them to the same property/value on a new data
object:
const data = {
rating: this.rating,
title: this.title,
text: this.text,
name: this.name,
location: this.location,
email: this.email,
files: this.files
};
Can some sort of object destructuring be used to accomplish this instead or is it unrelated to this use-case?