Javascript basic concept.....
我们提供的服务有:网站制作、做网站、微信公众号开发、网站优化、网站认证、黄岛ssl等。为上1000+企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的黄岛网站制作公司
[@more@]function Circle(radius) { this.radius = radius; }
Circle.PI = 3.141592; Circle.UNIT = new Circle(1);
Circle.prototype.area() { // notes: must explicitly specify thiskeyword to property return Circle.PI * this.radius * this.radius; }
Circle.max = function (a,b) { if (a.r > b.r) { return a; }else { return b; } }
uniqueID = function(){ // user can set id back to 0 by: uniqueID.id = 0 if (!arguments.callee.id) arguments.callee.id = 0; return arguments.callee.id++; }; uid = (function(){ // closure, id is persistent and private var id = 0; return function(){ return id++; }; })(); var ret = ""; var i = 10; while (i--) { ret += uniqueID() + "t"; uniqueID.id = 0; } alert(ret); i = 10; ret = ""; while (i--) { ret += uid() + "t"; } alert(ret);
文章题目:JavascriptStudyMemo
转载源于:https://www.cdcxhl.com/article10/ggsgdo.html
成都网站建设公司_创新互联,为您提供移动网站建设、网站设计、企业建站、App开发、网站制作、用户体验
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联