Sign in
apache
/
cordova-js
/
refs/heads/cb-4.2.3-node-modules-for-coho-only
/
.
/
node_modules
/
array-reduce
/
example
/
sum.js
blob: ede09c8d1a3c392a777d00053b85a3b20453b57a [
file
] [
log
] [
blame
]
var
reduce
=
require
(
'../'
);
var
xs
=
[
1
,
2
,
3
,
4
];
var
sum
=
reduce
(
xs
,
function
(
acc
,
x
)
{
return
acc
+
x
},
0
);
console
.
log
(
sum
);