How do I pop off the first array element with jquery?
javascript, jquery
Solution
Plain javascript will do:
data.urls.shift()
On `shift()` method:
Removes the first element from an array and returns that element. This method changes the length of the array.
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/shift
Problem
I'm iterating through an array of json data but need to remove the first element prior to the iteration. How do I remove the initial element? This is what I have so far: ``` $.post('player_data.php', {method: 'getplayers', params: $('#players_search_form').serialize()}, function(data) { if (data.success) { // How do I remove the first element ? $.each(data.urls, function() { ... }); } }, "json"); ```