change position of element in array using javascript

change position of element in array using javascript