Material interview question

Basic Javascript Questions about Higher Order Functions and asked to code it.