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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:24:53+00:00 2026-06-01T08:24:53+00:00

http://jsfiddle.net/J2KuY/ In test2, you can see that instead of removing the node from the

  • 0

http://jsfiddle.net/J2KuY/

In test2, you can see that instead of removing the node from the array, it is replacing the node with ‘null’.

What am I doing wrong, and how can I remove it completely?

Edit: using Splice instead of delete. Updated fiddle here: http://jsfiddle.net/J2KuY/1/

  • 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-01T08:24:55+00:00Added an answer on June 1, 2026 at 8:24 am

    Here’s a sample with chaining

    //say you have these arrays
    var test1 = [{
        "Country": "Spain",
        "info info1": 0.329235716,
        "info info2": 0.447683684,
        "info info3": 0.447683747},
    {
        "Country": "Chile",
        "info info1": 1.302673893,
        "info info2": 1.357820775,
        "info info3": 1.35626442},
    {
        "Country": "USA",
        "info info1": 7.78805016,
        "info info2": 26.59681951,
        "info info3": 9.200900779}];
    
    var test2 = [{
        "Country": "Germany",
        "info info1": 0.329235716,
        "info info2": 0.447683684,
        "info info3": 0.447683747},
    {
        "Country": "China",
        "info info1": 1.302673893,
        "info info2": 1.357820775,
        "info info3": 1.35626442},
    {
        "Country": "France",
        "info info1": 7.78805016,
        "info info2": 26.59681951,
        "info info3": 9.200900779}];
    
    
    //similar to jQuery, wrap them in an object
    function $W(param) {
        var obj = {};
    
        //set data
        obj.data = param;
    
        //augment the object with a remove function
        obj.remove = function(key, val) {
            var i = 0;
            //loop through data
            while (this.data[i]) {
                if (this.data[i][key] === val) {
                    //if we have that data, splice it
                    //splice changes the array length so we don't increment
                    this.data.splice(i, 1);
                } else {
                    //else move on to the next item
                    i++;
                }
            }
            //be sure to return the object so that the chain continues
            return this;
        }
    
        //return object for operation
        return obj
    }
    
    //the following will look strangely similar to jQuery
    
    //remove chile, then USA
    var result1 = $W(test1).remove('Country', 'Chile').remove('Country', 'USA');
    
    //remove germany and china
    var result2 = $W(test2).remove('Country', 'China').remove('Country', 'Germany');
    
    //should only have spain and france
    $('#test2').val(JSON.stringify(result1)+JSON.stringify(result2));​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://jsfiddle.net/YaMhn/8/ ^^^^Take a look and see if you can help solve this Ok so
http://jsfiddle.net/motocomdigital/uTV5k/18/ I've updated using toggle instead on click - though still can't get smooth
http://jsfiddle.net/ADLrh/ Hopefully you can see what I'm after. The three 'fillers' on the top
http://jsfiddle.net/zTTxu/ How can I animate once when page1 load example: animate 'a' to 'b'
http://jsfiddle.net/FS4zT/ If you visit the above link you see what am describing below. Summary:
http://jsfiddle.net/FYtJH/1 The filtering select needs to warn users that they're about to change the
http://jsfiddle.net/fSrBv/ I'm having an issue here where in my From field I'm able to
http://jsfiddle.net/3V6MM/ Please tell me how can I write common style for class=property-title to display
http://jsfiddle.net/fJkBU/1/ That's my code. Basically, I have an iFrame whose source may change. I
http://jsfiddle.net/cwUcM/ I've gone through all of the other threads that seems to have a

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.