Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Adam Maley5,946 Points
Unshift vs shift...poor choice of naming.
Why does it seem that taking an item off of the front should be Unshift? And putting on on top the front should be Shift?
Martin Lecke14,384 Points
Not sure if you have started with dates and the Date() object. But months starts to count from 0-11 but days starts at 1, was very confusing at first
Steven Parker227,114 Points
My guess is that when you remove the first item, it "shifts" all the other items up. And "unshift" just because it does the opposite of "shift".
If you'd been part of the initial development team, what would you have named those functions?
I always thought "push" and "pop" were an odd pair. I'd probably have named them "push" and "pull" instead.
kevinardoTreehouse Project Reviewer
The best way for me to remember them was thinking that unshift and push both have the letter u in them and that they add to the array. And then it was easier to remember that shift and pop is the opposite and removes . It really helped sorting them out this way, but still it was some trial and error to remember them.