code: function onceify(f) {
    var ran, ret;
    return function() {
      return ran ? ret : (ran=true, ret=f.apply(this,arguments));
    };
  }
docs: Make create a version of a function which runs just once on first call. Returns same value on succeeding calls.