You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@TheSoniix The details for the duplicateObject and deepDuplicateObject methods are above. Please respond to this issue so that I can assign it to you (GitHub unfortunately does not allow me to assign an issue if you have not replied on that issue). Thanks for your contributions!
Sorry for the long break. Unfortunately I had a lot to do at the university.
I have written two recursive functions that deeply clone arrays and objects.
It works with the datatypes: null, undefiend, string, number, boolean, object, Date and array.
There is only one problem:
Functions of objects are not passed
I think it's totally fine to point out this case in the documentation, so that the users use this functions correctly.
We should have a method that duplicates an object, like this:
You must use a for loop for this method to copy over all the keys and their corresponding values to the new object.
We should also have a method that duplicates an object and all inner objects, like this:
We encourage using the
duplicateObject
method and recursion to create thedeepDuplicateObject
method.The text was updated successfully, but these errors were encountered: