I'm having trouble in figuring out what JavaScript code would work in swapping two values (numbers in this case) in an array.
The function (referred to as move
) will swap the position of the value that you clicked with the position of "". The array values are displayed on the page and the function initiates when you click on any number (via onclick
).
boxArray = ["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15",""]
function move() {
}