<!DOCTYPE html>
<html>
<head>
<script data-require="lodash.js@*" data-semver="4.16.2" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.16.2/lodash.js"></script>
<script src="script.js"></script>
</head>
<body>
<h1>_.cloneDeep demo - lodash.js</h1>
Open console to observe _.cloneDeep demo<br/>
Cloned object properties ( Using _.cloneDeep method ) will not have reference to original object properties.
</body>
</html>
var _l = _;
var inspectObj = {'first_name':'Parvesh', 'last_name':'Tandon'};
var clonedObj = {};
console.log('\n_cloneDeep method demonstration i.e cloned object properties will not have reference to original object properties.');
clonedObj = _l.cloneDeep(inspectObj);
console.log('Original object : '+JSON.stringify(inspectObj));
inspectObj.first_name = 'Pinnu';
console.log('Original object after modification : '+JSON.stringify(inspectObj));
console.log('Cloned object : '+JSON.stringify(clonedObj));