| 1 |
result = ""; |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var console = { |
| 7 |
log: function(arg) { result += "LOG: " + arg; }, |
| 8 |
debug: function(arg) { result += "DEBUG: " + arg; }, |
| 9 |
warn: function(arg) { result += "WARN: " + arg; }, |
| 10 |
error: function(arg) { result += "ERROR: " + arg; }, |
| 11 |
dir: function(arg) { result += "DIR: " + arg; } |
| 12 |
}; |
| 13 |
(function() { |
| 14 |
var fn = function(arg) { |
| 15 |
return "fn saw arg '" + arg + "'."; |
| 16 |
} |
| 17 |
var str = "wooo"; |
| 18 |
console.debug(str + "some \\ dodgy \" characters *$!?//" + (1+2) + (~2) + fn(str)); |
| 19 |
console.error(str + "some \\ dodgy \" characters *$!?//" + (1+2) + (~2) + fn(str)); |
| 20 |
|
| 21 |
|
| 22 |
console.log("hello :) world!"); |
| 23 |
console.log(" anything /) with a paren "); |
| 24 |
console.log(/^\)$/.test("hi")); |
| 25 |
|
| 26 |
|
| 27 |
if(true) |
| 28 |
console.log("foo"); |
| 29 |
else |
| 30 |
var two = "two"; |
| 31 |
|
| 32 |
var bar; |
| 33 |
true ? console.log("bizarre") : (bar = true); |
| 34 |
true ? (bar = true) : console.log("bizarre"); |
| 35 |
|
| 36 |
(function() { |
| 37 |
return console.debug("Debug return statement."); |
| 38 |
})(); |
| 39 |
(function() { |
| 40 |
return console.error("Error return statement."); |
| 41 |
})(); |
| 42 |
})(); |