aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-11-18 14:34:54 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-11-18 14:34:54 -0800
commit42b3bb7206356f6543737696d3bbd75ebe2aad4f (patch)
tree6c5b3d2855f13f0084a3f972f029686c726bd1af /src/utility.js
parent7d95ee5784c4e1bd475aef46ebcdf4f4cac5cfbe (diff)
phi progress, almost all unoptimized tests pass
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utility.js b/src/utility.js
index 9661f865..53555aa5 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -131,6 +131,10 @@ function sumTruthy(x) {
return x.reduce(function(a,b) { return (!!a)+(!!b) }, 0);
}
+function sumStringy(x) {
+ return x.reduce(function(a,b) { return a+b }, '');
+}
+
function loopOn(array, func) {
for (var i = 0; i < array.length; i++) {
func(i, array[i]);