lodash _.clone, _.cloneDeep test
_.clone, _.cloneDeep test
by Ravindra Athreya
HTML
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<button id='bt'>Test Start</button>
<div id='ori'></div>
<div id='clone'></div>
<div id='deepClone'></div>
JavaScript
const result = {
"status": "SUCCESS",
"responseCode": "RINS_PMT_BNDL_DTL_DATA_002_01",
"responseText": "Payment Bundle Details fetched successfully.",
"totRecCnt": 1,
"recordsAvailable": false,
"onAccountConsumptionResponse": {
"bundleId": 9274,
"bundleName": "AUT Jul 2017 - Jun 2019 Apple Music",
"view": "OACA",
"payments": [
{
"type": "Payment",
"entityId": 381,
"entityName": "ICE",
"currencyCode": "EUR",
"serviceTypeId": 5,
"regionId": 2,
"contentGroupId": 79,
"contentGroupName": "Apple Music - Family Monthly",
"periodType": "Q",
"fiscalPeriod": "FY17Q4",
"grossPayment": 1600000.59,
"netPayment": 0,
"onAccountAmt": 1600000.5900000001,
"consumptions": [
{
"periodType": "Q",
"fiscalPeriod": "FY17Q3",
"type": "Net with On-Account",
"oaAccountAmt": 211000.5900000001,
"oaBalanceId": 1766,
"caBalanceId": 0
},
{
"periodType": "Q",
"fiscalPeriod": "FY17Q4",
"type": "Net with On-Account",
"oaAccountAmt": 1389000,
"oaBalanceId": 2123,
"caBalanceId": 0
}
]
},
{
"type": "Payment",
"entityId": 381,
"entityName": "ICE",
"currencyCode": "EUR",
"serviceTypeId": 5,
"regionId": 2,
"contentGroupId": 306,
"contentGroupName": "Apple Music - 3For1-Winback-Family",
...