+ 1

For loop error in javascript?

I mostly code in c++, I know the basics of JavaScript, barely. and I'm confused as to why this code isn't working? a simple For loop isn't working so I have no idea what I'm doing. https://code.sololearn.com/cxvlkz0jA1J6/?ref=app

5th Sep 2017, 5:13 PM
K1llJ0Y
K1llJ0Y - avatar
4 Answers
+ 3
it's JavaScript not Java, he's just put the code into a Java project by accident
5th Sep 2017, 8:40 PM
Styxincewa
Styxincewa - avatar
+ 2
var FizzBuzz=""; for(var i=0;i<100;i++){ var FizzBuzz=""; if(i%3!=0 && i%5!=0){ FizzBuzz+=i; } if(i%3==0){ FizzBuzz+="Fizz"; } if(i%5==0){ FizzBuzz+="Buzz"; } document.write(FizzBuzz); create web code and add that to js tab and it should run ;)
5th Sep 2017, 5:55 PM
Styxincewa
Styxincewa - avatar
+ 1
This is not a JavaScript code,It's java and I'm not good with Java,
5th Sep 2017, 5:18 PM
Joel Roy
Joel Roy - avatar
+ 1
first of all you are trying to incorporate JavaScript into Java so that is where all the errors are coming from
5th Sep 2017, 5:53 PM
Styxincewa
Styxincewa - avatar