How to remove N elements from specific index in array with TypeScript

1 Answer

0 votes
let arr: Array<string> = ['TypeScript', 'C', 'C++', 'Java', 'Python', 'PHP']; 
  
const index = 2

arr.splice(index, 3);
 
console.log(arr); 
 
   
   
   
   
/*
   
run:
   
["TypeScript", "C", "PHP"] 
  
*/

 



answered Oct 23, 2021 by avibootz
...