JavaScript: Fixed array operations

The original code for getting an element at the given index

```
  | "[]" == fun
  , (idx:[]) <- args =
    array ++ index idx
```

does not work since `array` is the empty string. Same problem when putting the element at the given index.