People Inc. interview question

Vanilla js