Contentful Interview Question

JavaScript refactoring