3

Is there a nifty trick for PHP's array_pop() in Javascript?

In lieu of any niftiness, I will accept elegance and/or brevity.

2 Answers 2

3
var foo = [1,2,3];
foo.pop();
Sign up to request clarification or add additional context in comments.

Comments

2

Javascript has a pop function: http://www.w3schools.com/jsref/jsref_pop.asp

2 Comments

While that page covers the salient points, it does so with bad examples and masses of advertising. W3Schools is very low quality through out (often having massive security problems with its tutorials) so please don't link to it. MDC is usually a much better JS reference: developer.mozilla.org/en/JavaScript/Reference/Global_Objects/…
Also, to complete the airhead moment, I was looking for shift(). :S Time for bed I guess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.