1World Interview Question

Javascript related logic