Functional Programming Break Continue Javascript Interview Question