Demonstration of write/writeln functions and for/in loop
The JavaScript code:
var numlinks = 0;
document.writeln('<table border="1">');
document.writeln('<tr><th>Property</th><th>Value</th></tr>');
for (var prop in document) {
var value = document[prop];
if (value == "") value = " ";
document.writeln('<tr><td>' + prop + '</td><td>' + value + '</td></tr>');
}
document.writeln('</table>');