Skip to content

Base on lodash.set, But the difference between Array and Array-like object

Notifications You must be signed in to change notification settings

noyobo/assign-set

Repository files navigation

assign-set

Base on lodash.set, But the difference between Array and Array-like object

const assignSet = require('assign-set');

assignSet(obj, 'a.2.c', 'value');
obj = { a: { 2: { c: 'value' } } };

assignSet(obj, 'a[2].c', 'value');
obj = { a: [undefined, undefined, { c: 'value' }] };

The difference of lodash.set

const lodash = require('lodash.set');

assignSet(obj, 'a.2.c', 'value');
obj = { a: [undefined, undefined, { c: 'value' }] };

assignSet(obj, 'a[2].c', 'value');
obj = { a: [undefined, undefined, { c: 'value' }] };

About

Base on lodash.set, But the difference between Array and Array-like object

Resources

Stars

Watchers

Forks

Packages

No packages published