Есть решение, если вы хотите заменить без временной переменной:
function moveItemInArray(categories, previousIndex, currentIndex){
categories = categories || [1,2,3,4,5,6]; // you wont here in your solution
previousIndex = previousIndex || 1; // you wont here in your solution
currentIndex = currentIndex || 2; // you wont here in your solution
console.log(categories.toString());
categories[currentIndex] = categories[previousIndex] + (categories[previousIndex] = categories[currentIndex]) - categories[currentIndex];
console.log(categories.toString());
}
<body onload="moveItemInArray()"></body>