PwC interview question

Asked to code some basic JavaScript questions