swaping array of items in angular code example Example: swap elements in array typescript [elements[0], elements[3]] = [elements[3], elements[0]];