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

Incorrect behaviour of Array.splice #289

Closed
Markeli opened this issue Aug 1, 2023 · 2 comments
Closed

Incorrect behaviour of Array.splice #289

Markeli opened this issue Aug 1, 2023 · 2 comments

Comments

@Markeli
Copy link
Contributor

Markeli commented Aug 1, 2023

Method Array.Splice works incorrect.

Step to reproduce

Here is JS script example with comments:

let arr = [1, 2, 3, 4, 5]; // array with 5 items

arr.splice(1, 0, 6); // from index 1 delete 0 items and add 1 new item - 6

Expected result

Expects array [1, 6, 2, 3, 4, 5] with 6 items.

Actual result

Got array [1, 6, 2, 3, 4] - array with 5 items and without last item (5)

@nilproject
Copy link
Owner

Thank you

@Markeli
Copy link
Contributor Author

Markeli commented Aug 2, 2023

Thanks for the fix!)

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

2 participants