Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Return a clone of an object or array
- * @param {Object|Array} obj The object or array to clone
- * @return {Object|Array} An exact copy of the object or array
- */
- var clone = function (obj) {
- if (!obj) return;
- return JSON.parse(JSON.stringify(obj));
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement