Last active
November 16, 2018 03:03
-
-
Save colorwebdesigner/647e86b79048a7eedfac2d74ddf08d5f to your computer and use it in GitHub Desktop.
JS debug helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* [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