
Ask HN: JavaScript code explainer? - codininj
Is there a website I can paste in a bunch of JS code and it&#x27;ll go over in detail of what the code does exactly?  for example<p>function factorial(n) { 
     var digit = 1;
     while(n &gt; 1) {
        digit *= n;
        n--;
     }
     return digit;
}<p>this is basic but some codes get pretty complex and want a tool to help make sense of code.
======
lollipop25
Learn how to use the browser's debugger, how to plant breakpoints, how to step
through the code, and how to read the scope.

[https://developer.chrome.com/devtools/docs/javascript-
debugg...](https://developer.chrome.com/devtools/docs/javascript-debugging)

For snippets like above, you don't even need a web page. In place of a page
and breakpoint approach, you can put a `debugger;` statement at the start of
the function. Open a browser, F12, paste the code in the console, call the
function, pretty-print the code _then_ step through it.

------
detaro
Don't think so. Explaining code in a way that is useful is extremely hard to
automate (read: "many have tried, nothing really works")

