Deep copy of on object in pure javascript
{
var personA = {
name: 'John',
age: 32
}
var personB = clone(objectA);
console.log(personB.name, personB.age);
}
{
define(['./clone'], function(deepCopy){
// Do your code ...
var personA = {
name: 'John Doe',
age: 35
};
var personB = deepCopy.clone(personA);
// Do your code ...
})
}
{
module.import('./clone').then(function (deepCopy) {
// Do your code ...
var personA = {
name: 'John Doe',
age: 35
};
var personB = deepCopy.clone(personA);
// Do your code ...
})
}