CodeSilhouette

Now supports indenting!

function beginningWhitespace(stt){ stt = stt.replace(/\t/g, ' ') var foundSpaces = false; spaceAmt = 0; while (foundSpaces == false){ var currentChar = stt.substring(spaceAmt, spaceAmt+1); var currentCharIsWhitespace = /\s/.test(currentChar); if (!currentCharIsWhitespace) {foundSpaces = true} else if (spaceAmt == stt.length) {foundSpaces = true} else {spaceAmt++}; }; return spaceAmt; } Generate

This tool generates a "silhouette" of your code. I wrote it over the weekend as a way to teach myself JavaScript.



Hit Generate to see how the above code's silhouette looks.

you can check out the source on GitHub

Permalink to this silhouette