I have an object with a method, destroy:
let object = {
destroy() {
handleDestroy.call(null, this);
}
}
function handleDestroy(obj) {
obj = null;
}
I know that technically the object is not destroyed even if it did work, but I am wondering why I can't reassign objects to null or other types of objects this way? When I call handleDestroy with the object as a parameter, or if I invoke the destroy method, object remains unchanged.