<prompt> Kuandika code kwa ajili ya kubadilishana vipengele viwili katika safu fulani.  <response>: Heres an example code for swapping two elements in an array in JavaScript:javascriptfunction swaparr, firstIndex, secondIndex let temp arrfirstIndex; arrfirstIndex arrsecondIndex; arrsecondIndex temp; Example usage:let array 1, 2, 3, 4;swaparray, 1, 2; after this, array is now 1, 3, 2, 4 