immutable-permute
v0.0.2
Published
Permute two items of an array with immutability
Downloads
2
Readme
Immutable-permute
It's a simple module that allows to create a new array by permuting two values of a previous array.
No additonnal dependencies.
Usage
npm install immutable-permute
var permute = require('immutable-permute')
// Indice to permute
var indiceX = 0
var indiceY = 2
// new array created
var newArray = permute([1, 2, 3], indiceX, indiceY)
console.log(newArray) // prints [3, 2, 1]