A plugin to make Backbone.js keep track of nested attributes - looking for maintainers! https://github.com/afeld/backbone-nested/issues/157
444
stars
83
forks
source link
lo-dash and sparse arrays converting previously set indexes as holes #98
Closed
mohitmayank closed 4 years ago
with lo-dash setting arrays with object notations or objects with numeric indexes or sparse arrays makes holes in array
if i am setting following keys
set('base.child.2.test', 100); or set('base.child[2].test', 100); //sparce array
where child already have a 0 index. it gets converted to undefined.
starting - base = { child : [ { test : 50 } ] }; model.set('base', base);
model.set('base.child.2.test', 100);
the result is
base = { child : [ undefined, undefined, { test : 100 } ] };
This problem appears when using lo-dash instead of underscore.