[arr[0], arr[1]] = [arr[1], arr[0]]
let arr = [ { id: 1, name: 'Number1' }, { id: 2, name: 'Number2' }, ]; [arr[0], arr[1]] = [arr[1], arr[0]] console.log(arr) // 0: {id: 2, name: "Number2"} // 1: {id: 1, name: "Number1"}