Created
December 21, 2012 06:09
-
-
Save heavenshell/4350978 to your computer and use it in GitHub Desktop.
6 行目の callback() の出力が undefined になる理由が良くわからない。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
'use strict' | |
var Sample = { | |
foo: function () { | |
var callback = this.bar; | |
callback(); | |
this.bar(); | |
}, | |
bar: function () { | |
console.log(this); | |
} | |
}; | |
Sample.foo(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
undefined | |
Object { foo=function(), bar=function()} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment