Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 29, 2022 06:31 am GMT

How to Remove First Element from Array in Javascript

Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/javascript/how-to-remove-first-element-from-array-in-javascript

In this post, I'm sharing a short post on how to remove the first element value from an array in Javascript. If you need to remove the first value of the array before processing the data then array.shift() done this.

Here is the example solution below:

<script>var websites = ['google.com', 'facebook.com', 'youtube.com'];websites.shift();console.log(websites);// result: ["facebook.com", "youtube.com"]</script>

I hope this tutorial can help you. Kindly visit here https://codeanddeploy.com/blog/javascript/how-to-remove-first-element-from-array-in-javascript if you want to download this code.

Happy coding :)


Original Link: https://dev.to/codeanddeploy/how-to-remove-first-element-from-array-in-javascript-2e6f

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To