-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
45 lines (27 loc) · 770 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
$(document).ready(function(e) {
//Print Number from 1 to 100 to browser
for(var i = 1; i<=100; i++)
{
//if divisible by 15 - Why do I need to put divisible by 15 first for it to work?
if(i%15 === 0){
$("ul").append("<li>Fizz Bizz</li>");
}
//if divisibkle by 3
else if(i%3 === 0){
$("ul").append("<li>Fizz</li>");
}
//if divisible by 5
else if(i%5 === 0){
$("ul").append("<li>Bizz</li>");
}
//if divisible by 3 and 5
else {
$("ul").append("<li>"+i+"</li>");
}
}
//Check to see if number is divisible by 3 or 5
//If not divisible by 3 or 5 just say the number.
//If visible by 3 say fizz
//if divisible by 5 say buzz
//If divided by both say fizz buzz
});