javascript - Is it possible to delete the object itself, not the reference -


var = {     "example" : true };  var x = [a], y = [a];  delete x[0];  console.log(y); 

in above code, possible have deleted, not reference in x ?

that's garbage collector. long there's reference object, not garbage collected.

if want cleaned up, make sure there no more references.

so answer question, no, there's no way explicitly destroy object. if a , y[0] still referencing it, can't x variable.

to clear, x[0] not referencing a. pointing same object in memory a referencing.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -