PARTech Interview Question

Asked to perform some tasks in Javascript