Question d’entretien chez Tinder

How can you solve this javascript class problem