DigiValet interview question

Write some pseudo code in JavaScript