【发布时间】:2014-01-02 15:46:12
【问题描述】:
这可能吗?
function foo() {
// do stuff
}
foo.prototype = {
// stuff...
bar: function() {
// do some things with this, where this refers to foo
},
bar.prototype: {
// set some definitions for bar to work with.
// Where does "this" go and what does it refer to?
}
}
【问题讨论】:
-
是的,我遇到了一些基本问题。我不知道去哪里所以我在这里问:)
标签: javascript function object prototype