-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclass.html
53 lines (47 loc) · 2.26 KB
/
class.html
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
49
50
51
52
53
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<meta name="viewport" content="user-scalable=no,width=640" />
<title>JS Class</title>
<script type="text/javascript" src="scripts/debugger.js"></script>
<script type="text/javascript" src="scripts/range2.js"></script>
</head>
<body>
<p id="plog"></p>
<p id="vstatus"></p>
<p id="license" style="color:#fff">
<img src="http://i.creativecommons.org/l/by-sa/3.0/nz/88x31.png" alt="Creative Commons Licence"><br />
<em>These demos by <a href="mailto:[email protected]">Revlin John </a> are licensed under the <a href="http://creativecommons.org/licenses/by-sa/3.0/nz/deed.en_GB">Creative Commons Attribution-ShareAlike 3.0 License, 2009-2016</a></em>
</p>
<script type="text/javascript" >
Debugger.on = true;
Debugger.out = document.getElementById('plog');
Debugger.log = function ( m, r) {
if( r !== undefined ) m = r.replace(/\$1/, m);
if(Debugger.on) Debugger.out.innerHTML += "<br /><br />\n"+ m;
};
Debugger.log( "Range is a "+ typeof Range );
Debugger.log( "Range.prototype is an "+ typeof Range.prototype );
var rng1 = new Range(1,3);
Debugger.log( "rng1 is an "+ typeof rng1 );
Debugger.log( "rng1 has "+ typeof rng1.includes );
Debugger.log( "rng1 is "+ rng1 );
Debugger.log( "Does rng1 include 2? "+ rng1.includes(2) );
rng1.foreach( Debugger.log, "The number $1 is within rng1." );
var rng2 = new Range(10,13);
Debugger.log( "rng2 is an "+ typeof rng2 );
Debugger.log( "rng2 is "+ rng2 );
Debugger.log( "Does rng2 include 2? "+ rng2.includes(2) );
rng2.foreach( Debugger.log );
Debugger.log( "Is rng1 the same kind as rng2? "+
(rng1 instanceof Range && rng2 instanceof Range) );
Debugger.log( "Is rng1 the same as rng2? "+ (rng1 === rng2) );
var rng3 = new Range(100,103);
Debugger.log( "rng3 is an "+ typeof rng3 );
Debugger.log( "rng3 is "+ rng3 );
Debugger.log( "Does rng3 include 2? "+ rng3.includes(2) );
rng3.foreach( Debugger.log );
Debugger.log( "Is rng1 the same kind as rng3? "+
(rng1 instanceof Range && rng3 instanceof Range) );
Debugger.log( "Is rng1 the same as rng3? "+ (rng1 === rng3) );
</script>
</body></html>