I just closed this question for being a direct duplicate of this other question (trying to copy a javascript array using assignment). It got reopened right away. When I commented, Scott Sauyet, who I assume is the user who reopened the question, replied:
The answer there will solve the problem, yes, but there are better solutions to the underlying problem.
OP never asked for a better solution. OP even admitted that their solution wasn't the best one and that they are still learning.
With that in mind, should the questionquestions like these be closed as duplicateduplicates or left open for a better solution to emerge?