Implement once(fn)
Write once(fn) that returns a wrapped version of fn which only ever actually calls fn on the first invocation — every subsequent call returns the same cached result without calling fn again.
const init = once(() => { console.log("initializing"); return "ready"; });
init(); // logs "initializing", returns "ready"
init(); // no log, still returns "ready"