I searched for this, but appeared empty
is it possible in javascript to create an instance of an object that has a set time for life, after which it will be destroyed?
the case will be that an element is added to the array every 5 seconds and displayed visually, each element must then be deleted after it has been visible for a minute. I hesitate to run the timeout function, checking the array every second to clear them.
source
share