I have a Mapper function that I want to call its prototype function method which is foo. However for some reason it's not executing when I use mapper.prototype.foo(). Is there a way to call it outside of the function?
function Mapper() {
return (site) =>
new Promise((resolve, reject) => {
resolve("yes");
});
}
Mapper.prototype.foo = function() {
console.log("afsd");
};
const mapper = new Mapper();
mapper.prototype.foo();
mapper("google.com");