transpose-2d-array
v1.0.4
Published
This method is used to transpose 2D array.
Downloads
32
Maintainers
Readme
You can use this method to transpose 2D array.
Install
$ npm i transpose-2d-array
Usage
import transpose from "transpose-2d-array"
or
const transpose = require("transpose-2d-array")
const arr = [
[[1], [2]],
[[1], [2]],
[[1], [2]],
[[1], [2]]
]
const result = transpose(arr)
// result will be
//
// [
// [[1], [1], [1], [1]],
// [[2], [2], [2], [2]]
// ]