Everforth Apex Systems interview question

Rewrite a function using ES6.