I have one simple array like:
var cellOrder = [1,2,3,4]
I want to exchange elements like suppose a second element with first element.
A
Use swapAt method,
var arr = [10,20,30,40,50] arr.swapAt(2, 3)
Use the index to swap element.