So I am making this code assignment, and when I went to validate it, it seems the JavaScript wasn't being "called." So I checked my code. The HTML elements call the JavaScript okay, there are no typos, and I still haven't found the problem!
HTML
<html>
<head>
<title>Conditional statements and Loops</title>
</head>
<body>
<script type="text/javascript" src="pattern_javascript.js">
</script>
</body>
</html>
JS
function loop() {
var asterisk = ["*", "**", "***", "****", "*****", "******", "*******", "********"];
var text = "";
var i;
for (i = 0; i < asterisk.length; i++) {
text += asterisk[i] + "<br>";
}
}
loop()
` by `\n`). Use the [browser console (dev tools)](https://webmasters.stackexchange.com/q/8525) (hit `F12`) and see your output there. If you want to output it in HTML, use `document.body.innerHTML = text;`. Try figuring out where to put one of these lines of codes yourself; you want to output this when you call the `loop` function, so it must be in the `loop` function body, but not every iteration, so outside `for`, but after the string is finished. So where do you put it? – Sebastian Simon Jul 02 '20 at 15:30