Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. /**
  2. * Return a clone of an object or array
  3. * @param {Object|Array} obj The object or array to clone
  4. * @return {Object|Array} An exact copy of the object or array
  5. */
  6. var clone = function (obj) {
  7. if (!obj) return;
  8. return JSON.parse(JSON.stringify(obj));
  9. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement