Skip to content

Instantly share code, notes, and snippets.

View angus-c's full-sized avatar

angus croll angus-c

View GitHub Profile
@angus-c
angus-c / gist:1334100
Created November 2, 2011 16:28 — forked from abozhilov/gist:1333507
Arguments default value (allow empty args)
function func(a, f) {
return function (args) {
args = args || {};
args.__proto__ = a;
f.call(this, args);
};
};
var f = func({foo : 10, bar : 20}, function (args) {
@angus-c
angus-c / gist:1081818
Created July 14, 2011 02:08 — forked from max-mapper/gist:1007605
BS ≈ BreakfastScript
Conditionals
( false :)
console.log "if"
:( true )
console.log "else if"
:()
console.log "else"