Getting intermediate result of Javascript code

Mar 20, 2014 at 9:37 AM
Hi,

I'm using Jint to run javascript codes from my .NET program. Now I get some bug in the generated output. Is there a way so that I can get the intermediate values of variables in the JS code, like we do in a HTML page using document.write()? For example, in the code
function f(a) {
var i=a, j=i+1, k=i+j; 
// PRINT value of i
var i = 20;
// PRINT value of i
return k; 
}

Can I get the value of i in the console or a log file in the above code.

Thank you.
Mar 20, 2014 at 5:28 PM
First please use the latest version available on github or nuget if you are not already using it.

Then if you look at the github's page samples you will find how to make the Console available in your script and use it.