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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:31:00+00:00 2026-06-08T09:31:00+00:00

Possible Duplicate: JavaScript Array Delete Elements So, in javascript, I have this set up:

  • 0

Possible Duplicate:
JavaScript Array Delete Elements

So, in javascript, I have this set up:

global.menu = [{
   name: item1,
   price: price1,
   message: message1
},
{
   name: item2,
   price: price2,
   message: message2
},
{
   name: item3,
   price: price3,
   message: message3
}];

And my question is pretty simple, but how would I delete an object from this array?
To select an object, I’m using this command:

global.HandleMenu = function (b) {
    var c = menu.filter(function (d) {
        return d.name == b;
    });
    c.forEach(function (d) {
        Say(d.message);
    });
};

So yeah. Can I just add delete d;, or d.remove() inside the forEach function? Or am I missing something?

  • 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-08T09:31:01+00:00Added an answer on June 8, 2026 at 9:31 am

    use filter and re-assign

    global.menu = global.menu.filter(function(a){ return a.item != "be delete" };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Javascript swap array elements I have a array like this: this.myArray =
Possible Duplicate: Javascript - array.contains(obj) What's wrong with this: var zipCodes =(['90001','90002','90003']); Test if
Possible Duplicate: Length of Javascript Associative Array I have a JSON that looks like
Possible Duplicate: PHP : Create array for JSON I have an array like this
Possible Duplicate: Javascript Array.forEach HowTo break? Given that I have a forEach loop, how
Possible Duplicate: indexOf method in an object array? I have a javascript array which
Possible Duplicate: Easiest way to find duplicate values in a JavaScript array Javascript array
Possible Duplicate: Is Chrome's JavaScript console lazy about evaluating arrays? I have the following
Possible Duplicate: javascript object, access variable property name? I'm trying to call a method
Possible Duplicate: JavaScript losing “this” object reference with private/public properties Why does the second

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.