How to deep copy (clone) an object with array members in Javascript?
问题 Introduction I have a Class Persons that contains an array of Person and functions : function Persons() { this.mItems = []; // Array of Objects Person } Persons.prototype = { calculateScores : function() { // Do some stuff } } The Class Person has members and functions : function Person(name) { this.name = name; // Name of the Person this.score = 0; } Person.prototype = { calculateScore : function() { // Do some stuff } } I want that the program does the following things : var persons = new