$ ->
window.app.helpers = new class Helpers
constructor: (@name) ->
@slideRecipeId = $("#slideRecipe")
@specialities = ["A", "B", "C"]
setTimeout @countUpRecipes, 3000
countUpRecipes: ->
@slideRecipeId.html(@specialities[Math.floor(Math.random() * @specialities.length)])
The problem is that on load I get these errors:
Uncaught TypeError: Cannot read property 'length' of undefined
What's wrong with the code ? Thanks.