function once (fn) {
var called = false;
return function () {
if (!called) {
called = true;
fn.apply(this, arguments);
}
}
}
转载于:https://www.cnblogs.com/shiyunfront/p/9001722.html
function once (fn) {
var called = false;
return function () {
if (!called) {
called = true;
fn.apply(this, arguments);
}
}
}
转载于:https://www.cnblogs.com/shiyunfront/p/9001722.html