swap 2 ways in the array on a click functionalityangularjs code example Example: javascript switch items in array var b = list[y]; list[y] = list[x]; list[x] = b;