Skip to content

Instantly share code, notes, and snippets.

@AdamBrodzinski
Last active October 15, 2015 21:17
Show Gist options
  • Save AdamBrodzinski/fff116fb8c5dc20aa0db to your computer and use it in GitHub Desktop.
Save AdamBrodzinski/fff116fb8c5dc20aa0db to your computer and use it in GitHub Desktop.
example
cleanNum = _.chain("(123) 456-7890")
.removeSpaces()
.removeParens()
.run(someOtherFuncWoMixin, p1, p2) // good for time where you dont want to mixin to lodash/underscore
.removeChar('-')
.value()
// some utils file
...
removeSpaces = function(str) {
return str.replace(/\s/g, '');
};
_.mixin({removeSpaces, removeParens, removeDashes});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment