Provide a coffeescript implementation of the same

Same behaviour as js version, only a little less code on behalf of coffeescript's terseness.