Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let ex = ['a', 'b', 'c']
- let ex1 = [['a','b'], [['c']]]
- let ex2 = {
- a: 1,
- b: 2,
- c: 3
- }
- let ex3 = {
- a: [1,2,3, {g: 6, h: 7}],
- b: {
- d: 4,
- e: 5
- },
- c: {
- f: [6,7,8]
- }
- }
- console.log(deepClone(ex)) // [ 'a', 'b', 'c' ]
- console.log(deepClone(ex1)) // [ [ 'a', 'b' ], [ [ 'c' ] ] ]
- console.log(deepClone(ex2)) // { a: 1, b: 2, c: 3 }
- console.log(deepClone(ex3)) // { a: [ 1, 2, 3 ], b: { d: 4, e: 5 }, c: { f: [ 6, 7, 8 ] } }
Add Comment
Please, Sign In to add comment