Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
abstain23 committed Jan 14, 2020
1 parent d9e8469 commit 10a6fd2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions every morning/0112.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var a = {n:1}
var b = a
a.x = a = {n:2}
console.log(a.x)
console.log(b)
18 changes: 18 additions & 0 deletions every morning/0113.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var x = 3, //12
obj = {
x:5
};
obj.fn = (function () {
this.x *= ++x //12
return function (y) {
this.x *= (++x) + y //
console.log(x) //13
}
})()

var fn = obj.fn
obj.fn(6) // 13
fn(4) //234
console.log(obj.x, x) //95 234

//g: x 13 o:x 95

0 comments on commit 10a6fd2

Please sign in to comment.