![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript 积经
文章平均质量分 76
jianghuyue
Software Engineer @HP
展开
-
javascript之函数作用域和闭包[function scope and closure]
what is the closure?在计算机领域当中, a closure is a function that is evaluated in an environment containing one or more bound variables. 当该函数被调用时, 它可以访问该环境中的变量,直接使用closure的例子如,函数式语言如ML和LISP。在其它一些语言中构造原创 2008-09-01 15:06:00 · 753 阅读 · 0 评论 -
JavaScript 定义类和继承类的基本步骤
首先, 是看下JavaScript中创建一个Class的基本步骤, 拿一个例子来说明这个问题:step 1:定义Class的构造函数(construct)。/** * Rectangle class definition. */function Rectangle(w, h) { this.width = w; this.height = h;}小贴士:var r = new R原创 2009-04-17 16:49:00 · 713 阅读 · 0 评论