Contact: aviboots(AT)netvision.net.il
41,230 questions
53,732 answers
573 users
const array = [7, 8, 9, 0, 3]; const x = array[0]; array[0] = array[array.length - 1]; array[array.length - 1] = x; console.log(array); /* run: [3, 8, 9, 0, 7] */