0

I am using JS Bin and realize that the for loop are not working for me on JS Bin. I get an "Unexpected token ;" error

Here is my code on JS Bin

Event the simplest for loop that prints numbers from 1 to 10 does not work.

Like so:

for(var i=0;i<10;i++){
   console.log("hi");
}// "Unexpected token ;"
raneshu
  • 363
  • 2
  • 16
  • 46
  • Interestingly, I am getting "missing ) after for-loop control". In Node.js, this code executes correctly. I am assuming some kind of bug in JSBin... – Robert Rossmann Jan 04 '15 at 11:13
  • @raneshu: The code works correctly, thus it is not quite the code you're having trouble with or you're using jSBin incorrectly. Either way, the question isn't appropriate for SO, it's either "how do I use JSBin?" which is a question for JSBin, or "Why doesn't this code work?" with code that obviously *does* work. – T.J. Crowder Jan 04 '15 at 11:17
  • @RobertRossmann and T.J.Crowder - Thank you for the information. It probably is a bug in JSBin. Perhaps someone would be able to explain why there is an Unexpected token error in a commonly used JavaScript debugging tool like JSBin. Perhaps the answer would be helpful and timesaving to the SO community moving forward. – raneshu Jan 04 '15 at 11:33

1 Answers1

0

Add "//noprotect" to your code. Its getting caught in a bug in the loop protection. This question should really have been raised on our open source github issues (linked from the menu).