Skip to content

Instantly share code, notes, and snippets.

@ypetya
Created October 21, 2016 16:10
Show Gist options
  • Save ypetya/3ce49224b3b657c4f6c16c4f34f4aced to your computer and use it in GitHub Desktop.
Save ypetya/3ce49224b3b657c4f6c16c4f34f4aced to your computer and use it in GitHub Desktop.
Quick an' dirty polyfill for lodash4 unset
function unset(o,path) {
if(path.indexOf('.')==-1) {
delete o[path];
} else {
var o2=path.split('.'),
ending=o2.pop();
unset(o[o2],ending);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment