/    Sign up×
Community /Pin to ProfileBookmark

hi there i was just wondering what the use for the pop() function and the shift() function in the javascript array object… seems very pointless to me, can someone tell me how it can benefit you

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@tirnaMar 26.2011 — Read These For More

pop()

[URL="http://www.w3schools.com/jsref/jsref_shift.asp"]

shift()[/URL]
Copy linkTweet thisAlerts:
@lordspaceMar 26.2011 — When you're tired of using the one then you can switch to the other (even though they do different things) ?
Copy linkTweet thisAlerts:
@svidgenMar 26.2011 — They're there to allow you to treat arrays like queues or stacks without having implement your own push(), pop(), shift(), and unshift() methods.
×

Success!

Help @mohannadj_92 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...