How can I completely remove an object from an array in Javascript? -
i have been using following code:
formdata.objectivedetails.push(emptyobjectivedetail);
this pushes new emptyobjectivedetail object onto end of array called objectivedetails.
if example array of objectivedetails contains 13 objects how remove 1 @ position 5? assume make null want remove length of array becomes 12.
this might off topic have been considering adding underscore.js. done underscore?
using underscore.js
objectivedetails = _.without(objectivedetails, _.findwhere(arr, {id: 5}));
Comments
Post a Comment