How to remove the first element from an array in JavaScript

1 Answer

0 votes
let arr = ["javascript", "php", "c", "c++"];

arr.shift();

console.log(arr);

    
    
    
/*
run:
    
["php", "c", "c++"]
    
*/

 



answered Feb 2, 2021 by avibootz

Related questions

1 answer 206 views
2 answers 198 views
1 answer 164 views
2 answers 211 views
1 answer 173 views
...