-
-
Save AdamBrodzinski/fff116fb8c5dc20aa0db to your computer and use it in GitHub Desktop.
example
This file contains 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
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