I\'m having a hard time figuring out how to move an array element. For example, given the following:
var arr = [ \'a\', \'b\', \'c\', \'d\', \'e\']; <
var arr = [ \'a\', \'b\', \'c\', \'d\', \'e\'];
const move = (from, to, ...a) =>from === to ? a : (a.splice(to, 0, ...a.splice(from, 1)), a); const moved = move(0, 2, ...['a', 'b', 'c']); console.log(moved)