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

deleteToDo() doesn't clone objects #58

Closed
dangerdak opened this issue Jul 7, 2017 · 1 comment
Closed

deleteToDo() doesn't clone objects #58

dangerdak opened this issue Jul 7, 2017 · 1 comment

Comments

@dangerdak
Copy link

Not sure if this is an actual issue but:

The deleteToDo function filters the original array so it does return a new array with the deleted item missing, however I think each item of the new array will be a reference to the objects in the original array, rather than copies of the objects.

So although the delete function itself doesn't edit the original it doesn't return a completely new array - not entirely sure if this is an actual issue, as if you then went on to edit the item presumably the edit function would clone each object before making the edit...

https://github.com/FAC-11/week2-atoms/blob/master/logic.js#L35

@absorpheus
Copy link
Contributor

filter method creates a new array without effecting the array that it is applied on.

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