World Class Web Components
❓ CHALLENGE
const weakMap = new WeakMap();
const arr = [{}, {}, {}];
arr.forEach((obj, index) => weakMap.set(obj, index));
arr.splice(1, 1); // Remove the second element
const result = arr.map(obj => weakMap.get(obj));
console.log(result);