Moving from coffee to JS