1.0.4 • Published 4 years ago
transpose-2d-array v1.0.4
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]]
// ]