重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
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);