Pull to refresh
0
0
Send message
с иммутабельностью:
const swap = (arr, i1, i2) => {
  const tmp = [...arr];
  [tmp[i1], tmp[i2]] = [arr[i2], arr[i1]];
  return tmp
}
const swap = (arr, i1, i2) => {
[arr[i1], arr[i2]] = [arr[i2], arr[i1]];
return arr
}

Information

Rating
Does not participate
Registered
Activity