html
html
1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html>
<head>
<title>Question</title>
</head>
<body>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
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
teamsArray = ["Blue Team","Red Team"];
function match(team1Name,team2Name,team1Goals,team2Goals){
this.team1Name = team1Name;
this.team1Goals = team1Goals;
this.team2Name = team2Name;
this.team2Goals = team2Goals;
this.team1Points = 0;
this.team2Points = 0;
this.update = function (){
if(team1Goals > team2Goals){
team1Points = 3;
team2Points = 0;
} else if(team2Goals > team1Goals){
team2Points = 3;
team1Points = 0;
} else if(team1Goals == team2Goals){
team1Points = 1;
team2Points = 1;
}
};
}
testMatch();
function testMatch(){
var match1 = new match(teamsArray[0],teamsArray[1],2,0);
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run