example:
var array = [1,5,2,3,4,6,7,8,9]
i went move index 2 to 5 !
var array = [1,2,3,4,5,6,7,8,9]
const fromIndex = 2; const toIndex = 5; const item = array[fromIndex]; array.splice(fromIndex, 1); array.splice(toIndex, 0, item);
Обсуждают сегодня