Convert coffee to pure js