Last active
August 29, 2015 14:09
-
-
Save lsongdev/0ff3d3414fc429b04733 to your computer and use it in GitHub Desktop.
underscore-extend.js
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
| _.mixin({ | |
| // Return a copy of the object containing all but the blacklisted properties. | |
| unpick: function (obj) { | |
| return _.pick(obj, _.difference(_.keys(obj), _.flatten(Array.prototype.slice.call(arguments, 1)))); | |
| }, | |
| average: function (arr) { | |
| return _.reduce(arr, function(memo, num){ | |
| return memo + num; | |
| }, 0) / arr.length; | |
| } | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment