Created
March 23, 2016 14:15
-
-
Save constdrop/9ff328789a0ded771ad9 to your computer and use it in GitHub Desktop.
javascript hash total one liner.
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
| hash = { a: 1, b: 2, c: 3 }; | |
| total = $.map(hash, function(v, k){return v;}).reduce(function(x, y){return x + y;}); | |
| // => 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment