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 9149275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:27:18+00:00 2026-06-17T11:27:18+00:00

Hey I have a simple loop which iterates a bunch of objects and checks

  • 0

Hey I have a simple loop which iterates a bunch of objects and checks if they match a variable and if they do, I want to remove it from the that list.

But i don’t know how to do it… this is the idea of what I am trying to do :

//my_objects is global (window.my_objects)

for(var i in my_objects){

   if(my_objects[i].value == 100){
       //remove it
    }

}

Is there any option besides creating an array for it ? I could only find delete which only deletes the property which means the object will still be itereated through my loop next time around.

This function is called every X seconds.

  • 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-06-17T11:27:19+00:00Added an answer on June 17, 2026 at 11:27 am

    Deleting the property from the object like this means that it won’t be in the iteration next time:

    for(var i in my_objects){
       if(my_objects[i].value == 100){
           delete my_objects[i];
        }
    }
    

    Note: this removes the object in question as a property on my_objects. If there is no other code with a reference to the now removed object, then it will be available for garbage collection and eventually freed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys. I'm building a simple blog and have my data returning from my
Hey guys I have an assigned array from mysql results and I simply want
Hey I have a problem with Simple DOM parser which is driving me nuts.
Hey guys, and thanks for looking. I have built the simple D2D app from
Hey guys just got a simple circle which i have drawn and was wondering
Hey guys I have what should be a simple question, but I am new
hey guys having this really simple problem but cant seem to figure out have
Hey this might be a simple question, but i have been stumped on it
Hey guys, this is simple but I can't make it workn... blah! I have
Hey I have downloaded one of the xml editors from some site. But don't

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.