This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <title>Test Suite with CSS</title> | |
| <script> | |
| function assert(value, desc) { | |
| var li = document.createElement("li"); | |
| li.className = value ? "pass" : "fail"; | |
| li.appendChild(document.createTextNode(desc)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Our person constructor | |
| function Person (name, age) { | |
| this.name = name; | |
| this.age = age; | |
| } | |
| // We can make a function which takes persons as arguments | |
| // This one computes the difference in ages between two people | |
| var ageDifference = function(person1, person2) { | |
| return person1.age - person2.age; |
NewerOlder