const dict = ['hello', 'haha', 'mama', 'moment', 'world', 'latest'];
expect(closest('h', dict)).toBe('haha');
expect(closest('he', dict)).toBe('hello');
expect(closest('m', dict)).toBe('mama');
expect(closest('mo', dict)).toBe('mama');
expect(closest('mome', dict)).toBe('mama');
expect(closest('latast', dict)).toBe('latest');
get closest string from dict