Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 36 lines (25 sloc) 0.871 kb
6d764ca @Kashomon website stuffins
authored
1
2 <html>
3 <head>
4 <title>Java Script Testing</title>
5 </head>
6
7 <body>
8 <h2> Javascript Testing </h2>
9
10 <script type="text/javascript">
11 var lessThan5P = function(e) { return e < 5; }
12 var greaterThan10P = function(e) { return e > 10; }
13 var equalTo7P = function(e) { return e == 7; }
14 var negativeP = function(e) { return e < 0; }
15
16 function or(a,b) { return a || b; }
17 function and(a,b) { return a && b; }
18 function not(a) { return !a; }
19
20 var predicate = and(or(or(lessThan5P, greaterThan10P), equalTo7P),
21 not(negativeP));
22
23 alert(predicate(-1)); // flase
24 alert(predicate(4)); // true
25 alert(predicate(11)); // true;
26 alert(predicate(7)); // true;
27 alert(predicate(6)); // false
28
29 </script>
30
31 </body>
32
33 </html>
34
35 <script src ="dojo.js" type="text/javascript"></script>
Something went wrong with that request. Please try again.