index: use `var` instead of `const`

For compatibility with older ES3 engines when used
in the browser (i.e. with browserify).