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 202 views
2 answers 191 views
1 answer 159 views
2 answers 208 views
1 answer 170 views
...