how to build dictionary app in javascript