Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shift and pop work in some weird fun way #33

Open
kristopolous opened this issue Jun 23, 2014 · 0 comments
Open

shift and pop work in some weird fun way #33

kristopolous opened this issue Jun 23, 2014 · 0 comments

Comments

@kristopolous
Copy link
Owner

I'm not sure whether this is a useful thing or whether it should be changed, but as an artifact of how it was created, shift will "move the tree along". That is to say that

[ { a: [1, 2] }, { b: [3, 4] } }

shifted will result in

[ { a: [2, 3] }, { b: [4] } ]

As opposed to the more conventional

[ { b: [3, 4] } ]

We can call this a bug if we want - but only because it doesn't do what conventional languages do. We can also just reclassify this as a feature, legitimately, some kind of "esoteric full-depth shift".

But if this was to be the case, then it should at least get christened a new name.

I made a gist of the test code that illustrates this: https://gist.github.com/kristopolous/a48600348341007af943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant