switch element array angular code example Example: switch element array angular [elements[0], elements[3]] = [elements[3], elements[0]];