underscore-observe
underscore-observe copied to clipboard
Observe event not triggering when using a string as array index
create
event isn't been triggered when we using a string
for an Array
index.
E.g:
var myArr = [
'a' => 'a'
];
_.observe( myArr, 'create', function( item, index ) {
console.log( 'tada' );
} );
myArr['b'] = 'b'; // Noting happens
myArr[0] = 'c'; // tada printed on the console