Skip to content

Instantly share code, notes, and snippets.

@benmj
Created March 14, 2014 20:46
#!/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