complete hightOrderFunction.js