Sorry if this is redundant, but I've searched through several Q&A's here but I still can't figure out what I'm doing wrong. I have an array saved as a backbone collection, and I need to delete an object from that array using its index:
deleteCartItem: function(e) {
var itemIndex = $(e.currentTarget).attr( "data-index" );
console.log(itemIndex)
console.log(this.collection)
console.log(this.collection.length)
var newCollection = this.collection.splice(itemIndex);
console.log(newCollection.length);
},
Here is my Backbone Collection:
[Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]