delete-operator
delete와 host objects
let i = 0;
const obj = {}
while(i<1000) {
obj[i] = i;
i+=1
}
const collection = new Map();
i = 0;
while(i < 1000) {
collection.set(i, i);
i+=1
}
console.time('object delete');
delete obj[500];
console.timeEnd('object delete');
console.time('map delete');
collection.delete('500');
console.timeEnd('map delete');Last updated
Was this helpful?