Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Clone Objects 34 points
- export default function (data) {
- // your code starts here
- const primitiveArrCopy = {...data};
- for(const key in primitiveArrCopy){
- if(Array.isArray(primitiveArrCopy[key])){
- primitiveArrCopy[key] = [...primitiveArrCopy]
- }
- }
- return primitiveArrCopy
- // your code ends here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement