@aldeka Nope. It's not pusheen & popeen. It's shifting & unshifting. push adds an element to the end of an array, pop removes an element from the end of an array. Unshift adds an a item to the top of an array, and shift removes the element from the top of an array.


shift: developer.mozilla.org/en-US/do…
uhshift: developer.mozilla.org/en-US/do…

push: developer.mozilla.org/en-US/do…
pop: developer.mozilla.org/en-US/do…

In python list.pop(0) will remove an item from the top of a list, but list.insert(<index>, <item>) will insert an item and list.append(<item) will add it to the end of the list.

I could go sets in python, but I think you get the jist. This just isn't pushing & poping.
@aldeka I guess I visualize stacks different. Usually when you print a list it prints lowest to highest.

@erm I think you meant to say "sorry for the mansplain, I'll do a dang Google search myself first next time"

@aldeka Gender had nothing to do with it. This has nothing to do with genitalia. I didn't even consider it when I wrote the post. print_r(), pformat() and even console.log() will all show an array from left to right or top to bottom. json formats it that way as well. So there are millions of examples where arrays/lists are visualized top to bottom. Sorry for my mistake. Good day.
Sign in to participate in the conversation
Wandering Shop

The Wandering Shop is a Mastodon instance initially geared for the science fiction and fantasy community but open to anyone. We want our 'local' timeline to have the feel of a coffee shop at a good convention: tables full of friendly conversation on a wide variety of topics. We welcome everyone who wants to participate, so long as you're willing to abide by our code of conduct.