Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected ',' #320

Open
mirek opened this issue Jul 7, 2014 · 3 comments
Open

Unexpected ',' #320

mirek opened this issue Jul 7, 2014 · 3 comments

Comments

@mirek
Copy link

mirek commented Jul 7, 2014

setInterval ->
  console.log new Date
, 1000

gives an error:

Syntax error on line 4, column 0: unexpected ',' (\u002C)
1 : 
2 : setInterval ->
3 :   console.log new Date
4 : , 1000
^ :~^
5 : 


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@provegard
Copy link

+1

I have a lot of code exactly like this. AFAIK this is the only way to specify arguments after a function argument, unless you define the function separately and then put all arguments on one line...

@forivall
Copy link

The alternative (and I do this, even though I'm only targetting coffee1), is to surround the function with parens:

setInterval (->
  console.log new Date()
), 1000 

@eddiemonge
Copy link

that just looks so weird and odd. the lonesome comma looks only slightly less weird though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants