Update index.js

The swap method has been updated, for be able of to swap two elements using the keys or the values, something as array.swap(key1, key2) or array.swap(someKey, someValue).

Now we can make:
var myArray = [ 'bread', 'bacon', 'lettuce', 'tomato', 'egg','cheese' ];
myArrayTome.swap(0,1);
myArrayTome.swap('cheese','egg');
myArrayTome.swap(1,'tomato');
myArrayTome.swap('bread',2);