I found in this link a solution to transfer some data from my model to a javascript object. The problem is that I have an error in visual studio indicating that the semi-colon is invalid but when I try to run my application, it works perfectly.
Here is a screenshot that show the error:

But if I remove the semi-colon, I now have this error:

In anyways, a javascript statement should always have a semi-colon at the end of the line.
What means this error if when I run my application, all works fine?
You might try enclosing it in a block:
Edit: This answer only applies to VS 2010. An upgrade in VS 2012 breaks this workaround as well.