{"id":36908,"date":"2019-01-17T04:04:46","date_gmt":"2019-01-17T04:04:46","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=36908"},"modified":"2019-01-17T04:10:02","modified_gmt":"2019-01-17T04:10:02","slug":"computer-science-shallow-copy-vs-deep-copy","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/computer-science-shallow-copy-vs-deep-copy\/","title":{"rendered":"Computer science: shallow copy vs deep copy"},"content":{"rendered":"\n<h2>Self-tutoring about computer science: the tutor mentions the difference between shallow and deep copy.<\/h2>\n<p>\nA shallow copy of an object is a new name for it. When the original changes, so will the shallow copy. Moreover, a change to the shallow copy will likewise change the original. After the shallow copy, there is only one actual object, but now it has an extra name.\n<\/p><p>\nA deep copy produces a new object with a new memory location. At first its elements are identical to the original. Henceforth, however, it&#8217;s independent of the original; either can change without affecting the other.\n<\/p>\n<p>\nSource:\n<p>\n<a href=\"https:\/\/stackoverflow.com\/questions\/184710\/what-is-the-difference-between-a-deep-copy-and-a-shallow-copy\">stackoverflow.com<\/a>\n<\/p>\n<p>\nJones, Darren. <em>JavaScript: Novice to Ninja<\/em>, 2nd edition. Collingwood: SitePoint Pty, 2017.\n<\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n","protected":false},"excerpt":{"rendered":"<p>Self-tutoring about computer science: the tutor mentions the difference between shallow and deep copy. A shallow copy of an object is a new name for it. When the original changes, so will the shallow copy. Moreover, a change to the &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/computer-science-shallow-copy-vs-deep-copy\/\"> <span class=\"screen-reader-text\">Computer science: shallow copy vs deep copy<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[],"class_list":["post-36908","post","type-post","status-publish","format-standard","hentry","category-computer-science"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/36908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=36908"}],"version-history":[{"count":4,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/36908\/revisions"}],"predecessor-version":[{"id":36913,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/36908\/revisions\/36913"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=36908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=36908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=36908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}