0

Is there anyway to remove item from the list using index?. I know this is common question but I didn't find yet the solution. Thanks in advance!

let array1 = ['one', 'two', 'three', 'four'];
remove_index = 2

output should = one, two, four

VLAZ
  • 22,934
  • 9
  • 44
  • 60

1 Answers1

2

Use splice, syntax: splice(start, deleteCount)

let array1 = ['one', 'two', 'three', 'four'];
array1.splice(2, 1);
Celsiuss
  • 852
  • 8
  • 18