Khan.randRange(4, 6) Khan.randRange(0, 999) Khan.randRange(0, arr_size-1) alistInsertPRO.initJSAV(arr_size, insert_pos,insert_value)

Your task in this exercise is to show the behavior for array-based list insertion. In the array displayed below, the "current" position is insert_pos.

The value to insert is insert_value, and it is to be inserted into the "current" position.

To move an element, click on it (to highlight it), then click on where you want it to go. You can insert the new value insert_value into a highlighted array position by clicking the "Insert" button.

[alistInsertPRO.userInput]
if (!alistInsertPRO.checkAnswer() && !guess[0]) { return ""; // User did not click, and correct answer is not // initial array state } else { return alistInsertPRO.checkAnswer(); }

To shift elements after "current" one position to the right, the first step could be swapping element arr_size - 1 with position arr_size

Then, keep swapping element i with i+1 until you make "current" empty for insertion

Insert value to "current" position