Skip to content

A collection of coding exercises and personal solutions to Exercism in JavaScript

Notifications You must be signed in to change notification settings

ayohana/exercism-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learning Resources

Shallow vs Deep Copy

Shallow Copy Deep Copy
Original and shallow copy both point to the same memory location Original and deep copy point to different memory locations
Use ... spread operator:
let shallowCopy = {...original}
Use JSON:
let deepCopy = JSON.parse(JSON.stringify(original))
Use Object.assign():
let shallowCopy = Object.assign({}, original)

About

A collection of coding exercises and personal solutions to Exercism in JavaScript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published