Question d’entretien chez AutoNation

I was given a problem to solve it with code (Javascript)