写一个闭包 ,每次调用都加1 var getId=(function(){ var i=0; return function(){ return i++}})()console.log(getId);console.log(getId);转载于:https://www.cnblogs.com/yangjinbo/p/10239802.html... Other 2024-07-30 25 点赞 0 评论 37 浏览