JSON.parse(JSON.stringify(object))
//Using JSON stringify function
var obj2 = JSON.parse(JSON.stringify(obj));
//Using lodash deep clone method
var obj2 = _.cloneDeep(obj, true);
//Angular framework comes with angular.copy function
var obj2 = angular.copy(obj);
// Using jQuery extend function
var obj2 = $.extend(true, {}, obj);
Assuming that you have only properties and not any functions in your object, you can just use:
var newObject = JSON.parse(JSON.stringify(oldObject));
const obj1 = { a: 1, b: 2, c: 3 };
// this converts the object to string so there will be no reference from
// this first object
const s = JSON.stringify(obj1);
const obj2 = JSON.parse(s);