Created
March 2, 2016 19:16
-
-
Save VoloshchenkoAl/63282a7d1ec5b6609c6f to your computer and use it in GitHub Desktop.
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
var arr = [[3,1,1,1], | |
[1,1,1,1], | |
[1,1,1,1], | |
[1,1,1,1]]; | |
var sum = arr.reduce(function(prev,cur,i){ | |
return prev+cur[i]+cur[arr.length-1-i]; | |
},0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment