Apricode interview question

Mainly basic JavaScript tasks and one pseudo code question