this is my code
const myFunction = function(number){
this.number = number;
const foo = () => {
return this.number;
}
myFunction.prototype.log = function () {
console.log(foo());
}
}
let firstInstance = new myFunction(12);
let secondInstance = new myFunction(13);
firstInstance.log() // 13
secondInstance.log() // 13
when I'm using the foo function, returns the last instance;
is there a way to using a private function and log function in the prototype of the function