Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksakae1216/d446f76e63bc5ed00c4cfc38ac0262ac to your computer and use it in GitHub Desktop.
Save ksakae1216/d446f76e63bc5ed00c4cfc38ac0262ac to your computer and use it in GitHub Desktop.
function myFunc(theObject) {
theObject.make = "Toyota";
}
var mycar = {make: "Honda", model: "Accord", year: 1998};
var x, y;
x = mycar.make; // x は "Honda" という値になる
myFunc(mycar);
y = mycar.make; // y は "Toyota" という値になる
console.log('x:' + x); //"x:Honda"が表示される
console.log('y:' + y); //"y:Toyota"が表示される
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment