how does "System.out.println" work in JS?... :)
<p>My background is in java and right now Im getting into learning Javascript. (I'm porting this java code that I made into javascript but it behaves a bit different than I expected?? If I use "console.log()" instead of "document.write" I'm NOT getting the same result..why?</p>

<p>thanks 4 yr time! Some insight will be very appreciated!</p>

<pre><code>var counter = 1;    

function println(str) {

    console.log(str);//

}   

for (var i = 1; i &lt;= 5; i++) {

  for (var j = i; j &lt; 5; j++) {

       document.write("#");
// println("#"); 


  }

  for (var k = 1; k &lt;= counter; k++) {

    document.write("*");
// println("*"); 

  }

  document.write("&lt;br/&gt;");
//println(" "); &lt;--- "\n" ? 

  counter+= 2; //
} // ends application
</code></pre>
