Skip to content

Instantly share code, notes, and snippets.

@heavenshell
Created December 21, 2012 06:09
Show Gist options
  • Save heavenshell/4350978 to your computer and use it in GitHub Desktop.
Save heavenshell/4350978 to your computer and use it in GitHub Desktop.
6 行目の callback() の出力が undefined になる理由が良くわからない。
$(document).ready(function () {
'use strict'
var Sample = {
foo: function () {
var callback = this.bar;
callback();
this.bar();
},
bar: function () {
console.log(this);
}
};
Sample.foo();
});
undefined
Object { foo=function(), bar=function()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment