nit: `typeof callback==="function"` => `typeof callback === "function"`