I have an Array[] this.unusedInstruments
:
[
{ label: 'one'},
{ label: 'two'},
{ label: 'three'}
]
and a function: (params getting passed in are verified as being 'one', 'two', or 'three'
removeInstrument: function(removedIntrument) {
var index = this.unusedInstruments.indexOf(removedIntrument);
delete this.unusedInstruments[index];
},
but I am not getting what I expected. I logged the index
, and it is always returning -1
despite the parameter. I am assuming that it is saying that the index doesn't exist, but I guess that means I don't know how to query the parent Array for the indexed Object.