Created
May 8, 2018 18:17
-
-
Save celestora/63e4a7383bb5b2c98a66ff8823ae3bb6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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