copyObj(obj) function - comparision with JSON.parse(JSON.stringify(obj))