Student directory

Report a typo

Inside the Student function, write a method getStudent() that displays the text "Student name: a, student surname: b, student age: c" via console.log(), where a, b, and c are parameters.

Please notice that you don't need to call student.getStudent() in the code.

Sample Input 1:

Sample Output 1:

Student name: Alex, student surname: Brown, student age: 28
Write a program in JavaScript
function Student(name, surname, age) {
this.name = name;
this.surname = surname;
this.age = age;

// write your function here
}

const student = new Student("Alex", "Brown", 28);
___

Create a free account to access the full topic