Skip to content

Instantly share code, notes, and snippets.

@celestora
Created May 8, 2018 18:17
Show Gist options
  • Save celestora/63e4a7383bb5b2c98a66ff8823ae3bb6 to your computer and use it in GitHub Desktop.
Save celestora/63e4a7383bb5b2c98a66ff8823ae3bb6 to your computer and use it in GitHub Desktop.
let substitute_property = (object, callback, sameObject) => {
function noop(){};
let nObj = sameObject ? object : {};
for(each in object) {
let sub = callback(object[each]);
nObj[each] = sub;
}
return nObj;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment