This was derived from another coders Codewars solution
Aim: The code at this point in time is used to return the sum of rows and columns and diagonals, to see if all the sums stated of this 4x4 magic, are the same number
var arr = [
[9, 6, 3, 16],
[4, 15, 10, 5],
[14, 1, 8, 11],
[7, 12, 13, 2]
];
var _r = arr.map(v => v.reduce((a, b) => a + b), 0)
var _c = _r(arr.map((v, i) => v.map((_, j) => arr[j][i])));
var _d1 = arr = arr.reduce((s, _, i) => s + arr[i][i], 0);
var _d2 = a => a.reduce((s, _, i) => s + a[a.length - 1 - i][i], 0);
console.log(_r);
console.log(_c);
console.log(_d1);
console.log(_d2)
Problem: However the thing I can't get my head round is what the underscores in this code are used for, any ideas?