Skip to content

Instantly share code, notes, and snippets.

View capnmidnight's full-sized avatar
💭
Apparently...

Sean T. McBeth capnmidnight

💭
Apparently...
View GitHub Profile
@capnmidnight
capnmidnight / banquo.js
Last active August 29, 2015 14:14
Javascript named arguments
// so named because why the hell not?
function banquo(func) {
var def = func.toString();
// find the comma-delimeted list of parameters
var params = def.match(/\(\s*(\w+(\s*,\s*\w+)*)\s*\)/)[1].split(',').map(function (p) {
return p.trim();
});
// extract out just the function body