Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
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,367 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 Parker210,475 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.