Turn negative array indices into offsets from the end of the array.
$ npm install babel-plugin-transform-negative-indices
.babelrc
{
"plugins": ["transform-negative-indices"]
}
$ babel --plugins transform-negative-indices script.js
require("babel-core").transform("code", {
plugins: ["transform-negative-indices"]
});