js object get copy code example
Example 1: js array get index
var fruits = ["Banana", "Orange", "Apple", "Mango"];
return fruits.indexOf("Apple"); // Returns 2
Example 2: javascript object get subset
const object = { a: 5, b: 6, c: 7 };const subset = (({ a, c }) => ({ a, c }))(object);console.log(subset); // { a: 5, c: 7 }