Package Exports
- multidim-array-index
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (multidim-array-index) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
multidim-array-index
map multidimensional array indices to monodimensional array index
Example
All code in the examples below is intended to be contained into a single file.
// 1-dim
var i3 = multiDimArrayIndex.bind(null, [3])
i3([0]) // 0
i3([1]) // 1
i3([2]) // 2
// 2-dim
var i2x2 = multiDimArrayIndex.bind(null, [2, 2])
i2x2([0, 0]) // 0
i2x2([0, 1]) // 1
i2x2([1, 0]) // 2
i2x2([1, 1]) // 3
// 3-dim
var i2x2x2 = multiDimArrayIndex.bind(null, [2, 2, 2])
i2x2x2([0, 0, 0]) // 0