HappyJayXin
12/6/2019 - 4:44 AM

Swap two value in a array.

Swap two value in a array.

function swap(arr, inx1, inx2) {
  [arr[inx1], arr[inx2]] = [arr[inx2], arr[inx1]]
};

semp([11, 22], 0, 1); // [22, 11]