JSFiddle - React, Tailwind, and code Playground

by guest271314

HTML

<input onclick="test()" text='test' type='button' />

JavaScript

$(document).ready(function() {
    var pList = new Object();
    pList["test"] = "test"; //this is being deleted from BOTH instances of the Obj
    pList["test1"] = "test1";
    pList["test2"] = "test2";
    pList["test3"] = "test3";
    pList["test4"] = "test4";
    var _pList = $.extend({}, pList);
    displayData(_pList);

    console.log(pList, "original");
});

function displayData(badData){
    delete badData.test;

    console.log(badData, "extended");
}