Let's say we have an array named '_arr' and I'm removing an item from it. However, before I remove the item, I log it to the console. The issue is that when I check the console log, it seems like the item has already been removed from the array. I've looked through the data system in Polymer Documentation, but I'm still confused about what might be causing this behavior.
Could it be a misunderstanding of how the data system operates, or should I be investigating another source for the problem?
EDIT: Just to clarify, '_arr' consists of an array of strings, and I'm triggering an event using:
this.fire('rmv-item' , {item: 'item content which is string'});
Below is the code snippet:
_removeItemFromArr: function(e) {
const index = this._arr.indexOf(e.detail.item) ;
console.log('array before remoivng item:' , this._arr , index); //item doesn't exist
if (index>-1) { this.splice('_arr' , index, 1 }
console.log('array after removing item: ' , this._arr , index); //item doesn't exist
},