Skip to content

Instantly share code, notes, and snippets.

@captainkovalsky
Created May 17, 2015 10:29
Show Gist options
  • Save captainkovalsky/ff5cad07e8e80a42cc1f to your computer and use it in GitHub Desktop.
Save captainkovalsky/ff5cad07e8e80a42cc1f to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/fojikoyape
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
console.clear();
var a = {
array: [1],
val: 90
};
var b = a;
b.val = 10;
a.array[0]++;
console.log(b.val);
console.log(b.array);
</script>
<script id="jsbin-source-javascript" type="text/javascript">console.clear();
var a = {
array: [1],
val: 90
};
var b = a;
b.val = 10;
a.array[0]++;
console.log(b.val);
console.log(b.array);</script></body>
</html>
console.clear();
var a = {
array: [1],
val: 90
};
var b = a;
b.val = 10;
a.array[0]++;
console.log(b.val);
console.log(b.array);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment