Write a JS class that represents a personal record. It has the following properties, all set from the constructor:
-
firstName
-
lastName
-
age
-
email
And a method toString(), which prints a summary of the information. See the example for formatting details.
Input:
The constructor function will receive valid parameters.
Output:
The toString()method should return a string.
Submit the class definition as is, without wrapping it in any function.
Examples:
Sample Input:
let person = new Person('Maria', 'Petrova', 22, 'mp@yahoo.com');
console.log(person);
Output:
Maria Petrova (age: 22, email: mp@yahoo.com)