Advertisement
kstoyanov

07. Get Persons

Sep 20th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve() {
  2.   class Person {
  3.     constructor(firstName, lastName, age, email) {
  4.       this.firstName = firstName;
  5.       this.lastName = lastName;
  6.       this.age = age;
  7.       this.email = email;
  8.     }
  9.  
  10.     toString() {
  11.       return `${this.firstName} ${this.lastName} (age: ${this.age}, email: ${this.email})`;
  12.     }
  13.   }
  14.   return [
  15.     new Person('Anna', 'Simpson', 22, 'anna@yahoo.com'),
  16.     new Person('SoftUni'),
  17.     new Person('Stephan', 'Johnson', 25),
  18.     new Person('Gabriel', 'Peterson', 24, 'g.p@gmail.com'),
  19.   ];
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement