Skip to content

Instantly share code, notes, and snippets.

@benmj
Created March 14, 2014 20:46
Show Gist options
  • Save benmj/9556491 to your computer and use it in GitHub Desktop.
Save benmj/9556491 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/node
var not = {};
function printCatch (name) {
try {
console.log(eval(name));
} catch (e) {
console.log("whoops, that isn't defined yet");
setTimeout(printCatch.bind(undefined, name), 0);
}
}
printCatch('not.def.yet');
not = {
def: {
yet: "boo yah"
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment