const test = [
[2, 7, 2],
[2, 5, 4],
[2, 1, 5],
[3, 1, 2]
]
var min = Math.min.apply(null, [].concat(...test));
var x = parseInt([].concat(...test).indexOf(min)/3);
var y = [].concat(...test).indexOf(min)%3;
alert("Min: "+test[x][y]+" Index x:" + x + " Index y:" + y)