title: javascript array error splice map function
body: <p>could you please help me understand the error in the following code, i am trying to run it in jsfiddle and says that there is an unexpected } right before the first call to console.log:</p>
  <pre><code>function deleteItem(type,id){
     var ids,index;
     ids = data.allItems[type].map(function(current){
       return current.id;
  
  });
  index = ids.indexOf(id);
  data.allItems[type].splice(index,1);
  
  
  }
  var data = {
       allItems:{
           exp:[{id:2,desc:'pants',value:200},{id:5,desc:'jacket',value:1200}, 
                {id:7,desc:'holiday',value:5800}],
           inc:[{id:7,desc:'salary',value:3000},{id:9,desc:'project',value:5000}]
            },
       total: {exp:9200,inc:11,000};
  };
  
  console.log(data);
  deleteItem('exp',5);
  console.log(data);
  </code></pre>