Skip to content

Instantly share code, notes, and snippets.

alert('6');
@marani
marani / once.js
Last active September 14, 2016 15:20
once
function once(fn) {
var executed = false;
var executer() {
if (!executed) {
fn.apply(arguments);
executed = true;
} else {
console.log('function already executed');
}
}