sary/User_agent)
    515. [ UTF-8 ](/en-US/docs/Glossary/UTF-8)
    516. [ UUID ](/en-US/docs/Glossary/UUID)
    517. [ UX ](/en-US/docs/Glossary/UX)
    518. [ Validator ](/en-US/docs/Glossary/Validator)
    519. [ Value ](/en-US/docs/Glossary/Value)
    520. [ Variable ](/en-US/docs/Glossary/Variable)
    521. [ Vendor Prefix ](/en-US/docs/Glossary/Vendor_Prefix)
    522. [ Viewport ](/en-US/docs/Glossary/Viewport)
    523. [ Visual Viewport ](/en-US/docs/Glossary/Visual_Viewport)
    524. [ Void element ](/en-US/docs/Glossary/Void_element)
    525. [ VoIP ](/en-US/docs/Glossary/VoIP)
    526. [ W3C ](/en-US/docs/Glossary/W3C)
    527. [ WAI ](/en-US/docs/Glossary/WAI)
    528. [ WCAG ](/en-US/docs/Glossary/WCAG)
    529. [ Web performance ](/en-US/docs/Glossary/Web_performance)
    530. [ Web server ](/en-US/docs/Glossary/Web_server)
    531. [ Web standards ](/en-US/docs/Glossary/Web_standards)
    532. [ WebAssembly ](/en-US/docs/Glossary/WebAssembly)
    533. [ WebDAV ](/en-US/docs/Glossary/WebDAV)
    534. [ WebExtensions ](/en-US/docs/Glossary/WebExtensions)
    535. [ WebGL ](/en-US/docs/Glossary/WebGL)
    536. [ WebIDL ](/en-US/docs/Glossary/WebIDL)
    537. [ WebKit ](/en-US/docs/Glossary/WebKit)
    538. [ WebM ](/en-US/docs/Glossary/WebM)
    539. [ WebP ](/en-US/docs/Glossary/WebP)
    540. [ WebRTC ](/en-US/docs/Glossary/WebRTC)
    541. [ WebSockets ](/en-US/docs/Glossary/WebSockets)
    542. [ WebVTT ](/en-US/docs/Glossary/WebVTT)
    543. [ WHATWG ](/en-US/docs/Glossary/WHATWG)
    544. [ Whitespace ](/en-US/docs/Glossary/Whitespace)
    545. [ WindowProxy ](/en-US/docs/Glossary/WindowProxy)
    546. [ World Wide Web ](/en-US/docs/Glossary/World_Wide_Web)
    547. [ Wrapper ](/en-US/docs/Glossary/Wrapper)
    548. [ XForms ](/en-US/docs/Glossary/XForms) Deprecated 
    549. [ XHTML ](/en-US/docs/Glossary/XHTML)
    550. [ XInclude ](/en-US/docs/Glossary/XInclude)
    551. [ XLink ](/en-US/docs/Glossary/XLink)
    552. [ XML ](/en-US/docs/Glossary/XML)
    553. [ XMLHttpRequest (XHR) ](/en-US/docs/Glossary/XMLHttpRequest)
    554. [ XPath ](/en-US/docs/Glossary/XPath)
    555. [ XQuery ](/en-US/docs/Glossary/XQuery)
    556. [ XSLT ](/en-US/docs/Glossary/XSLT)
    557. [ Zstandard compression ](/en-US/docs/Glossary/Zstandard_compression)

##  In this article

  * See also 

#  Shallow copy

A **shallow copy** of an object is a copy whose properties share the same [
references ](/en-US/docs/Glossary/Object_reference) (point to the same
underlying values) as those of the source object from which the copy was made.
As a result, when you change either the source or the copy, you may also cause
the other object to change too. That behavior contrasts with the behavior of a
[ deep copy ](/en-US/docs/Glossary/Deep_copy) , in which the source and copy
are completely independent.

More formally, two objects ` o1 ` and ` o2 ` are shallow copies if:

  1. They are not the same object ( ` o1 !== o2 ` ). 
  2. The properties of ` o1 ` and ` o2 ` have the same names in the same order. 
  3. The values of their properties are equal. 
  4. Their prototype chains are equal. 

See also [ the definition of _structural equivalence_ ](/en-
US/docs/Glossary/Deep_copy) .

The copy of an object whose properties all have primitive values fits the
definition of both a [ deep copy ](/en-US/docs/Glossary/Deep_copy) and a
shallow copy. It is somewhat useless to talk about the depth of such a copy,
though, because it has no nested properties and we usually talk about deep
copying in the context of mutating nested properties.

For shallow copies, only the top-level properties are copied, not the values
of nested objects. Therefore:

  * Re-assigning top-level properties of the copy does not affect the source object. 
  * Re-assigning nested object properties of the copy does affect the source object. 

In JavaScript, all standard built-in object-copy operations ( [ spread syntax
](/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax