Update index.js

Minor change - `if () {return ... } else if` -> `if () {return ...} if () {return ...}`