This is the 1st assignment.
Firstly console.log() is not working for me in the html script. It works on the browser console.
Then I switched over to document.write(). It is working, but I am not able to successfully make use of the new line ā\nā. Please see my code. Where did I go wrong?
<script>
var num_rows = 7;
var toPrint ="#";
for (var row = 0; row < num_rows; row++) {
document.write(toPrint + "\n");
// <br>
toPrint += "#";
}
</script>
The output appers as a single line in my case.
Edit by @gabba: You can use the Preformatted text to display code on your post