I’ve found that the following works if you’re not using jQuery and only interested in cloning simple objects (see comments).
JSON.parse(JSON.stringify(json_original));
Documentation
More Related Contents:
- How to iterate over a JavaScript object?
- Why can I add named properties to an array as if it were an object?
- How to map more than one property from an array of objects
- How to sum the values of a JavaScript object?
- Create an empty object in JavaScript with {} or new Object()?
- What’s the difference between “{}” and “[]” while declaring a JavaScript array?
- JavaScript, elegant way to check nested object properties for null/undefined [duplicate]
- Encoding Javascript Object to Json string
- Using JavaScript what’s the quickest way to recursively remove properties and values from an object?
- What’s the JavaScript’s Object.prototype behavior?
- JS associative object with duplicate names
- How to get all keys with values from nested objects
- How do I check if an array includes a value in JavaScript?
- Convert Array to Object
- How to concatenate properties from multiple JavaScript objects
- Javascript: how to dynamically create nested objects using object names given by an array
- Create an object from an array of keys and an array of values
- Access object properties within object [duplicate]
- how to iterate over inner objects / property in an object
- Mongoose/MongoDB result fields appear undefined in Javascript
- Access JavaScript Object Literal value in same object [duplicate]
- When should I automatically create an object even if `new` is forgotten?
- Elegant way to copy only a part of an object [duplicate]
- Javascript deep copying object [duplicate]
- Javascript – deepEqual Comparison
- Lodash create collection from duplicate object keys
- Changing data content on an Object Tag in HTML
- How to check null objects in jQuery
- Array of object deep comparison with lodash
- Push JSON Objects to array in localStorage