Swapping two items in a javascript array - Array.prototype.swap
$ npm install --save array-swap
var swap = require('array-swap');
var arr = ['apple', 'orange', 'banana', 'pear'];
arr.swap(1, 3);
// arr will be
// ['apple', 'pear', 'banana', 'orange']
MIT © Marko Jankovic