![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
wabil
这个作者很懒,什么都没留下…
展开
-
js封包
在独立的js文件里做封包:(function (parm) { 'use strict'; var Common = function(){ this.name ="john"; this.age = 20; } Common.prototype.setInfo = function(str,n) { this.name = str; this.age = n; }...原创 2021-04-26 21:30:02 · 496 阅读 · 0 评论 -
JS 闭包与立即执行函数
---------------JS 闭包与立即执行函数 demo---------------------//js filevar CarSpeed = (function(){ var speed = 0; console.log("Run once without calling."); function setSpeed( sp ){ speed = sp; } function getSpeed(){ return speed; } function speedUp.原创 2021-02-05 20:21:25 · 248 阅读 · 0 评论