Update index.js

Fixed typo (lable)
Replaced shift loop with splice
Removed unused dependency (map is natively available on arrays)
Removed code which will never be used (array[array.length] will always be undefined)
Merge pull request #1 from framp/patch-1

Update index.js