mirror of
https://github.com/beestat/app.git
synced 2026-03-24 02:18:05 -04:00
I was performing the same mutation on an object multiple times because I did not clone it or store the data separately.
11 lines
228 B
JavaScript
11 lines
228 B
JavaScript
/**
|
|
* Performs a deep clone of a simple object.
|
|
*
|
|
* @param {Object} object The object to clone.
|
|
*
|
|
* @return {Object} The cloned object.
|
|
*/
|
|
beestat.clone = function(object) {
|
|
return JSON.parse(JSON.stringify(object));
|
|
};
|