Skip to content

Instantly share code, notes, and snippets.

@lloss
Last active May 12, 2017 20:54
Show Gist options
  • Save lloss/a779601827a392c647392ee689547436 to your computer and use it in GitHub Desktop.
Save lloss/a779601827a392c647392ee689547436 to your computer and use it in GitHub Desktop.
kekekek
let f = [];
function addKek(func) {
if(typeof func === 'function'){for (let i = 0; i < f.length; i++) {if (f[i].includes(func)) {f[i][1] = true;return;}}
f = [...f, [func, false]];
}else{throw new Error('input should be a function')}
}
function launcKek() {
for (let i = 0; i < f.length; i++) {if(typeof f[1] !== 'undefined' ){!f[i][1] ? (()=> {f[i][0](); f[i][1] = true})() : delete f[i];}}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment