Different ways to create function
from javascript ninja book
by dandoyon
JavaScript
var canFly = function canfly() {
return true;
};
window.isDeadly = function isDeadly() {
return true;
};
var isAnon = function() {
return true;
};
document.writeln("<pre>");
document.writeln(isNimble + "\n");
document.writeln(canFly + "\n");
document.writeln(isDeadly + "\n");
document.writeln(isAnon + "\n");
document.writeln("</pre>");
// notice how still shows in writeln even though defined here
function isNimble() {
return true;
}