Hi
I want to copy array of objects in javascript with functions.
I have object like this
var User = function() {
    this.name = '';
    var surname = '';
    function f() {
        //some function here
    }
    this.sayHello = function() {
        console.log( 'Hello ' + this.name + ' ' + surname )
    }
}
var arr = [];
arr.push([ new User(), new User()]);
arr.push([ new User(), new User()]);
As you see, I have object with some private and public properties declared this and war and private and public functions.
Is there any method to copy this array? I user this method
function copy( arr ) {
    var c = [];
    for( var i = 0; i < arr.length; i ++ ) {
        c.push(arr[i].concat([]));
    }
}
In this method, when I changed some property of some object, property changes for copied object too.
var arr2 = copy(arr)
arr[0][0].name = 'name';
console.log(arr2[0][0].name) // prints 'name'
Is there method to copy nested array of objects with functions ? Than you.
