Closed manuschillerdev closed 3 years ago
Hello,
No, setting to undefined directly would be best bet. Other option is to get the value of the parent object, delete whatever property, and then set it back:
let item = dlv(obj, "items.0");
delete item.lastname;
dset(obj, "items.0", item);
Hope that helps
Is it possible to not only set values, but also delete properties at a given path?
What I would need in my case would be:
Obviously I can set the value to
null
orundefined
using set:but I actually need to be able to delete the property completely. Is this possible using dset?