constmemoizeTimeout=(fn,time)=>{letcache={};return(...args)=>{//Create hash.constn=btoa(args);//Erase cache.setTimeout(()=>{if(nincache){deletecache[n];}},time);//Find in cache or store new values. if(nincache){returncache[n];}else{letresult=fn(...args);cache[n]=result;returnresult;}}}
no need to clearInterval - couse it clean setInterval after first run and not work correct for many launches with different params
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
hi, looks like string
},time);
not in it place
i've fix your last example with time
no need to clearInterval - couse it clean setInterval after first run and not work correct for many launches with different params