I'm getting the values undefined even though it's populated. I think I've already populated it but feels like something is going wrong with the object's instance. That'd be great if someone can explain that where I'm going wrong.
function Student(fn, sn, a, d)
{
this.firstName = fn;
this.lastName = sn;
this.age = a;
this.degree = d;
this.displayStudent = displayStudent;
}
function displayStudent()
{
console.log(this.fn);
console.log(this.sn);
console.log(this.a);
console.log(this.d);
}
var studentObj = new Student("d", "r", 20,
"bachelors of science");
studentObj.displayStudent();
this.fnand so on would refer tothis.firstNameand so on?this.firstName- you don't have athis.fnproperty on Student.