title: Best practice for running a method specific to a subclass in a forEach loop
body: <p>I am writing some code that needs to loop through an array of objects continuously. There are several types of blocks, such as bricks, metal or sand, and I update their position and whether or not a player is touching them in one foreach loop. </p>
  
  <p>The sand needs to have a method by which it falls down when the player is standing on it. What is the best way in javascript to run a method specific to the sand object from within the foreach loop?</p>