Skip to content

Instantly share code, notes, and snippets.

@sairion
Created September 10, 2015 07:46
Show Gist options
  • Save sairion/6cdd96766a2ed880fb97 to your computer and use it in GitHub Desktop.
Save sairion/6cdd96766a2ed880fb97 to your computer and use it in GitHub Desktop.
debugwhen.js
function debugIf(condition) { // TODO: multi-args
var shouldDebug;
if (typeof condition === 'function') {
shouldDebug = condition();
} else {
shouldDebug = condition;
}
if (shouldDebug) debugger;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment