- Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathobjects_methods.html
More file actions
Latest commit
32 lines (27 loc) · 677 Bytes
/
Copy pathobjects_methods.html
File metadata and controls
32 lines (27 loc) · 677 Bytes
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
<!doctype html>
<htmllang="en">
<head>
<title>JavaScript Tutorial - Objects and Methods</title>
<linkrel="stylesheet" href="css/foundation.min.css"></link>
</head>
<body>
<!-- JAVASCRIPT -->
<scripttype="text/javascript">
functionteam(name,lastSuperbowlYear)
{
this.name=name;
this.lastSuperbowlYear=lastSuperbowlYear;
this.yearsSinceSuperbowl=lastSuperbowl;
}
functionlastSuperbowl()
{
varthisYear=2014;
varnumYears=thisYear-this.lastSuperbowlYear;
returnnumYears;
}
varRavens=newteam("Baltimore Ravens",2013);
document.write(Ravens.yearsSinceSuperbowl());
</script>
<!-- END JAVASCRIPT -->
</body>
</html>