title: How to destroy an object on Javascript from a class
body: <p>Ok I have this object from class</p>
  <pre class="lang-js prettyprint-override"><code>//Classes for actors ingame
  //Runtime actors 
  class Actor 
  {
      //public ActorHealth = 100; 
  
      constructor(name, x, y, team, mainTexture, InternalTexture, ActorHealth, ActorState ) 
      {
          this.name = name;
          this.x = x; 
          this.y = y;
          this.team = team; //Team 1 Players/hero  Team 2 Enemies
          this.mainTexture = mainTexture;//&quot;BloodForWebGladiators1.png&quot;; 
          this.InternalTexture=new Image();
          this.InternalTexture.setAttribute(&quot;src&quot;, this.mainTexture);  
          this.ActorHealth = 100;     
          this.ActorState = &quot;Alive&quot;; //&quot;Alive&quot; is alive, &quot;Dead&quot; is dead
      }
   
      //Set location for character sprite
      setLocation(px, py) 
      {
          this.x = px; 
          this.y = py;
      }
      
      //WIP
      ActorTakeDamage(DamageAmount)
      {
          this.ActorHealth -= DamageAmount; 
          console.log(&quot;FROM Actor taking damage now health is&quot;+this.ActorHealth ); 
          
          if( this.ActorHealth &lt;= 0 &amp;&amp; this.ActorState == &quot;Alive&quot; ) 
          {
              this.ActorDie(); 
          }
          
          spawnActor('PlayerBloodParticle', this.x, this.y, 1, &quot;BloodForWebGladiators1.png&quot;, &quot;Particle&quot;);   //actor 0  
      }
    
      ActorDie()
      {
          console.log(&quot;FROM Actor DYING is&quot;+this.ActorHealth );   
          //this.DestroySelf()
          this.ActorSetActorState(&quot;Dead&quot;);
          this.InternalTexture.setAttribute(&quot;src&quot;, &quot;GWArcherLoadingArrowDead.png&quot;);
          setInterval(this.DestroySelf.bind(this),3000.0); //Find a way to clear the timer
      }
    
      ActorSetActorState(NewActorState)
      {
          this.ActorState = NewActorState; 
          
      }
    
      ActorTick()
      {
          //TestFunction(); 
          if( DoesCollideXYWithXY(this.x, this.y, player_x, player_y, 2, 2 ) )
          {
              this.CollideOverlap();
          }
      }  
    
      CollideOverlap()
      {
  
      }
   
      DestroySelf()
      {
          DestroySpecificActorOfTheWorld(this); 
      } 
  }
  </code></pre>
  <p>As you can see it gets destroyed, all it does its remove self from specific actor from array, but how to actually erase it totally from the memory?????????</p>