Tekion interview question

Implement memoize function in js