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
  • 26,331
  • 9
  • 49
  • 67
Shainnah Jane
  • 221
  • 2
  • 15

1 Answers1

2

Use splice, syntax: splice(start, deleteCount)

let array1 = ['one', 'two', 'three', 'four'];
array1.splice(2, 1);
Celsiuss
  • 895
  • 7
  • 19