remove object from object array
<p>Hello I was trying to remove objects from object array that I have and then create another new object  (I'm using $.map() to create the new object ) </p>

<p>to remove this object from object(x) it's object.number has to match one of the number the number in array(y)</p>

<p>this following code works but i only remove the object that has the object.number = 40 
<a href="http://jsfiddle.net/minagabriel/C3d9T/4/" rel="nofollow">DEMO</a></p>

<p>Code : </p>

<pre><code>   var x =[ //this is the object 
  {name : 'mark' , number : '10' , color:'green'},
  {name : 'jeff' , number : '15' , color:'blue'} ,
  {name : 'joy' , number : '30' , color:'yellow'},
  {name : 'mick' , number : '15' , color:'red'},
  {name : 'mick' , number : '40' , color:'black'}] ; 

      var y =['40','15']; // i need to remove all object.number that match the 
        // number in this array

     var newObject = $.map(x  ,function(index, value){
        for(i in y){
         if(index.number == y[i])
        {return null ; }
       else{
        return index;
            }      
      }

    });
 console.log(newObject);​
</code></pre>

<p>the code above only remove the object that has 40 in it's object.number, how can i make this work?</p>
