Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7534713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:05:58+00:00 2026-05-30T06:05:58+00:00

I have run in to a problem I do not know how to code

  • 0

I have run in to a problem I do not know how to code in JavaScript really. The thing is I would like to be able to create a lot of objects added to an Array. when objects are created to be added to this array they will have a “lifetime”. When this lifetime runs out this object should be removed from the array.

What Im trying to build here is a particle system where particles will vanish from being rendered after the particles lifetime in question have expired.

Anyone who have a good idea or example for this?

I have thought about using setTimeout, setInterval and clearInterval but not sure how this would be most effective.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:05:59+00:00Added an answer on May 30, 2026 at 6:05 am

    Something like this?

    Update for Felix Kling:

    var a = [], next = function() {
        a = a.slice(0,-1);
        document.body.innerHTML += a.length + "<br />";
        if (a.length != 0)
            setTimeout(next, 100);
    };
    for (var i = 0; i < 100; i++) {
        a.push({hi: 1});
    }
    setTimeout(next, 100);​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run into a common, yet difficult problem. I do not use Photoshop
I have run into a rather weird little problem. In the following code I
I have run into a problem using PDO because an error was not caught.
I have a problem with my homework assignment and I do not know where
I have run into this problem before but never quite solved it. I have
I have run into a problem trying to modify a form I myself have
I have run into a problem w/ my model for databinding in WPF. I
I have run into a problem... I'm trying to use QTKit in an application
it seems I have run into a problem with Internet Explorer 7. I have
I've just installed VS2008 and have run into a problem that I'm sure can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.