Premium Features

Download Video

More Accurate Object Removal

Published 2 years ago

Currently to remove objects from our game we loop through the front of our array, then call a splice method. Although this'll work when we use in pairing with setTimeout, it will cause issues later on once our game gets more complex and requires more resources. As a result, here we will refactor any forEach loop, that also uses splice, to loop through its contents starting from the back of the array.


Want to participate?

Create a free Chris Courses account to begin


No comments yet, be the first to add one

Providing the lift to launch your development career

© 2024 Chris Courses. All rights reserved.