Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
23 lines (21 loc) · 552 Bytes

File metadata and controls

23 lines (21 loc) · 552 Bytes
Copy raw file
Download raw file
Edit and raw actions

Reference

Objects are never copied. They are passed around by reference.

// Imagine I had a pizza
var myPizza = { slices: 5 };
// And I shared it with You
var yourPizza = myPizza;
// I eat another slice
myPizza.slices = myPizza.slices - 1;
var numberOfSlicesLeft = yourPizza.slices;
// Now We have 4 slices because myPizza and yourPizza
// reference to the same pizza object.
var a = {},
  b = {},
  c = {};
// a, b, and c each refer to a
// different empty object
a = b = c = {};
// a, b, and c all refer to
// the same empty object
Morty Proxy This is a proxified and sanitized view of the page, visit original site.