Skip to content

Instantly share code, notes, and snippets.

View biilmann's full-sized avatar
💭
Waiting for pod to exist...

Mathias Biilmann biilmann

💭
Waiting for pod to exist...
View GitHub Profile
var countdown = function count(num) {
console.log(num);
if (num <= 0) { count(num - 1); }
}
countdown(2);
count(2);
if (console.log) {
var greet = function(name) { console.log(name); }
} else {
var greet = function(name) { alert(name); }
}
if (console.log) {
function greet(name) { console.log(name); }
} else {
function greet(name) { alert(name); }
}
function example4() {
var f = function() { console.log("First f"); }
return f();
var f = function() { console.log("Second f"); }
}
example4();
function example3() {
function f() { console.log("First f"); }
return f();
function f() { console.log("Second f"); }
}
example3();
function example2() {
f();
var f = function() { console.log("f"); }
}
example2();
function example1() {
f();
function f() { console.log("f"); }
}
example1();
// Function declaration
function hello() { console.log("Hello"); }
// Function expression
var hello = function() { console.log("Hello"); }
// Function expressions with binding identifier
var hello = function hello() { console.log("Hello"); }
<pop:sections>
<li class="<pop:first>first</pop:first> <pop:last>last</pop:last>"><a href="<pop:permalink/>"><pop:title/></a></li>
</pop:sections>
@biilmann
biilmann / redirects.js
Created March 18, 2013 22:30
Manual redirects
exports.get = {
"Product1": function(params) {
response.send("Redirecting", {Location: "/products/product1"}, 301);
},
"Product2": function(params) {
response.send("Redirecting", {Location: "/products/product2"}, 301);
}
}