Sulisunneerneq kodeqarneq iluatigut sananeqaatitsisoq arlaat niuerneqarnissaat
Nuummioqarneq JavaScriptimi kingornatigut qalipaataa: 

```javascript
function swap(arr, firstIndex, secondIndex) {
    let temp = arr[firstIndex];
    arr[firstIndex] = arr[secondIndex];
    arr[secondIndex] = temp;
}

// Qalipaataa:
let array = [1, 2, 3, 4];
swap(array, 1, 2);  // swap kattuffiat, array illuataa [1, 3, 2, 4] 
```