-
-
Notifications
You must be signed in to change notification settings - Fork 117
Splice
Héliton Nordt edited this page Jul 11, 2015
·
4 revisions
var Baobab = require('baobab');
var tree = new Baobab({
colors: ['red', 'blue', 'green'],
languages: {
google: ['js', 'python'],
microsoft: ['js', 'typescript']
}
});
tree.splice('colors', [0, 1]);
tree.splice(['languages', 'google'], [1, 1]);
// On update event
tree.get();
>>> { colors: [ 'blue', 'green' ],
>>> languages: { google: [ 'js' ], microsoft: [ 'js', 'typescript' ] } }