function once(f,obj) {
let count = 0;
let result;
return function () {
count++;
if (count==1) {
if(obj==undefined) {
obj = {};
}
result = f.apply(obj,arguments);
}
return result;
}
}
function once(f,obj) {
let count = 0;
let result;
return function () {
count++;
if (count==1) {
if(obj==undefined) {
obj = {};
}
result = f.apply(obj,arguments);
}
return result;
}
}