-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
49 lines (40 loc) · 1.03 KB
/
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
46
47
48
const userChoiceDisplay = document.getElementById('user-choice')
const resultDisplay = document.getElementById('result')
const possibleChoices = document.querySelectorAll('button')
let userChoice
let computerChoice
let result
possibleChoices.forEach(possibleChoice => possibleChoice.addEventListener('click', (e) => {
userChoice = e.target.id
userChoiceDisplay.innerHTML = userChoice
generateComputerChoice()
getResult()
}))
// var x=3;
// var y=7;
// var t=4
// document.write("addition\n", x+y-t);
// var y=40;
// var x=(y<=30)?"juma is too old":"juma is too young";
// document.write(x);
// var i=28;
// if(i>28)
// {
// document.write("the value of i is greater than 29");
// }
// else if(i=28){
// document.write("the value of i is equal to 28");
// }
// else{
// document.write("the value of i is less than 29");
// }
//switch statements
// var month=2
// switch(month){
// case 1:
// document.write("january");
// break;
// case 2:
// document.write("february");
// break;
// }