class Point {
constructor(x, y) {
this.x = x;
this.y = y;
this.isNum();
}
isNum()
{
if(typeof this.x !== 'number' || typeof this.y !== 'number' ) {
throw new Error('point is not a number ')
}
}
}
try{
var exampleNum = new Point(1,2)
} catch(e){
console.error(e)
}
console.log(exampleNum)