How to remove the first 2 elements from an array in Node.js

1 Answer

0 votes
const arr = ['javascript', 'node.js', 'typescript', 'c++', 'python', 'c#'];
 
arr.splice(0, 2);

console.log(arr); 
 
   
   
   
   
/*
run:
   
[ 'typescript', 'c++', 'python', 'c#' ]
   
*/

 



answered Jun 10, 2022 by avibootz

Related questions

...