the updated array
Tests inserting into an array at the given index
int[] vals = []; vals = vals.insertAt(0, 1); assert(vals == [1]); vals = vals.insertAt(0, 69); assert(vals == [69, 1]); vals = vals.insertAt(1, 68); assert(vals == [69, 68, 1]); vals = vals.insertAt(3, 420); assert(vals == [69, 68, 1, 420]); // Failure to insert (array stays the same) vals = vals.insertAt(5, 421); assert(vals == [69, 68, 1, 420]);
Inserts the given value into the array at the provided index