Say that we have an object like this one:
let obj = {a: "John", b: "Sarah", c: "Lara", d: "Joseph", e: "Roger"}
And an array of some of its keys:
let arr_of_keys = ["a", "d", "e"]
Is it possible to destructure the object using the predefined keys in the array, something along the lines of:
let {...arr_of_keys} = obj;
To finally end up with:
a = "John", d = "Joseph", e = "Roger"