How to remove the first 2 elements from an array in TypeScript

1 Answer

0 votes
const arr = ['javascript', 'typescript', 'node.js', 'c++', 'php', 'java'];

arr.splice(0, 2);

console.log(arr); 

  
  
  
  
/*
run:
  
["node.js", "c++", "php", "java"] 
  
*/

 



answered Jun 10, 2022 by avibootz
...