Created
February 22, 2014 00:25
-
-
Save lodestone/9146574 to your computer and use it in GitHub Desktop.
Somewhat comparable compact function to match ruby's compact method.
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
Array.prototype.compact = function() { return this.filter(function(e) { return e; }); }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment