Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
loverajoel committed Feb 13, 2016
1 parent 6736404 commit f07ec1c
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions _posts/en/2016-02-13-know-the-passing-mechanism.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ JavaScript is pass-by-value, technically. It is neither pass-by-value nor pass-b

```js

var me = { // 1
"partOf" : "A Team"
};
var me = { // 1
"partOf" : "A Team"
};

function myTeam(me) { // 2
function myTeam(me) { // 2

me = { // 3
"belongsTo" : "A Group"
};
}
myTeam(me);
console.log(me); // 4 : {"partOf" : "A Team"}
me = { // 3
"belongsTo" : "A Group"
};
}

myTeam(me);
console.log(me); // 4 : {"partOf" : "A Team"}

```

Expand All @@ -42,16 +42,16 @@ When we assigned a new object at #`3`, we are changing this reference value enti

```js

var me = { // 1
"partOf" : "A Team"
};
function myGroup(me) { // 2
me.partOf = "A Group"; // 3
}
myGroup(me);
console.log(me); // 4 : {"partOf" : "A Group"}
var me = { // 1
"partOf" : "A Team"
};

function myGroup(me) { // 2
me.partOf = "A Group"; // 3
}

myGroup(me);
console.log(me); // 4 : {"partOf" : "A Group"}

```

Expand Down

0 comments on commit f07ec1c

Please sign in to comment.