I don't understand the syntax error in my code
<p>my text editor does not like this piece of code I am not sure why</p>

<pre><code>&lt;script type="text/javascript"&gt;
function randmg(){
var img = [
      "banner1.png",
      "banner2.png",
      "banner3.png",
      "banner4.png"
]
var maxImg = img.length;
var randNum = Math.floor(Math.random()*maxImg)
return img[randNum]
}
&lt;/script&gt;
</code></pre>

<p>It says the error is in line four "var img - ["</p>

<p>I thought that i was the use/placement of var under the array but I have not been able to fix it</p>

<p>Changed to this</p>

<pre><code>function randmg(){
var img = ["banner1.png","banner2.png","banner3.png","banner4.png"];
var maxImg = img.length;
var randNum = Math.floor(Math.random()*maxImg);
return img[randNum];
}
</code></pre>

<p>But still having the same issue</p>
