class Student{
constructor(name, age)
{ this.name = name;
this.age = age;
}
}
function add()
{
Student.prototype.eyeColor = "Blue";
let std= new Student("john", 33);
console.log(std.eyeColor);
}
/*will display blue*/
function Student{
this.name = name;
this.age = age;
}
function add()
{
Student.prototype.eyeColor = "Blue";
let std= new Student("John", 33);
console.log(std.eyeColor);
}
/*will display blue*/