The following function produces the error 'scoreCounter is not defined' where it should be defined at that point as a prototype to Darts.
function Darts() {
this.Score = 0
this.x = 1
this.y = 1
}
Darts.prototype.scoreCounter = function(x,y) {
(unnecessary code for this quesiton)
}
const test = new Darts()
console.log(test.isPrototypeOf(scoreCounter))
how to fix this error(add the prototype correctly)
scoreCounter is expected to be part of test prototype as the output