Index of a multidimensional array
APL, 1 byte
⊥
Test it on TryAPL.
J, 2 bytes
#.
Where there's an APL, there's a J! Kind of. Takes dimensions as left arg and index as right arg. "Indexing a multidimensional array is essentially mixed base conversion."
JavaScript (ES6), 34 bytes
(d,a)=>a.reduce((r,i,j)=>r*d[j]+i)
Surely reduce
must be better than map
.