inject function

dynamic inject(
  1. dynamic a1,
  2. dynamic index,
  3. dynamic a2
)

Implementation

inject(a1, index, a2) {
  return a1.slice(0, index).concat(a2).concat(a1.slice(index));
}