var Direction = function(direction){ this.dom = null; this.init(direction); return this.dom; }中this.init(direction)是什么意思,这是定义的一个方法还是怎么回事呀?这几句代码,麻烦大神给讲解下.

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/20 11:26:36
varDirection=function(direction){this.dom=null;this.init(direction);returnthis.dom;}中this.init(direc

var Direction = function(direction){ this.dom = null; this.init(direction); return this.dom; }中this.init(direction)是什么意思,这是定义的一个方法还是怎么回事呀?这几句代码,麻烦大神给讲解下.
var Direction = function(direction){ this.dom = null; this.init(direction); return this.dom; }
中this.init(direction)是什么意思,这是定义的一个方法还是怎么回事呀?这几句代码,麻烦大神给讲解下.

var Direction = function(direction){ this.dom = null; this.init(direction); return this.dom; }中this.init(direction)是什么意思,这是定义的一个方法还是怎么回事呀?这几句代码,麻烦大神给讲解下.
this 指包含Direction 方法的对象 这个对象还有 init 方法 var XXX={ var Direction = function(direction){} var init = function(XXX){} }