Skip to content

Instantly share code, notes, and snippets.

@colorwebdesigner
Last active November 16, 2018 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colorwebdesigner/647e86b79048a7eedfac2d74ddf08d5f to your computer and use it in GitHub Desktop.
Save colorwebdesigner/647e86b79048a7eedfac2d74ddf08d5f to your computer and use it in GitHub Desktop.
JS debug helper
/**
* [deb] Debugging function
* Pass any kind of variables and
* see the result
*
* @return {[false]} [always]
*/
function deb() {
let msg = '';
if(arguments.length == 0) msg += '(!) debug: don\'t spend my time.\n';
for (let i = 0, j = arguments.length; i < j; i++){
msg += `arg${i} [${typeof(arguments[i])}]: ${arguments[i]}` + '\n';
}
msg += `---` + '\n';
console.log(msg);
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment