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 208 views
2 answers 198 views
1 answer 166 views
2 answers 213 views
1 answer 175 views
...