title: How to change value of an array element through javascript?
body: <p>I want to make a button that changes the value of an element in an array. I am trying to do it by the following code but the element does not change. As a self learning beginner, I am probably missing something very obvious and I would appreciate if someone can point that out to me.</p>
  
  <p>Thank you for your answers!</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;Change Array Value&lt;/title&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;textarea id="log2"&gt;&lt;/textarea&gt;
  &lt;input type="button" onClick="uClicked();" value="Click!"&gt;
  &lt;script&gt;
      var fer=[];
  
      for (i=0; i&lt; 15; i++){
              fer[i]=i+1;
      }
  
      function uClicked(fer){
          fer[12] = 10; 
          return fer[12];
      }
      log2.value = "fer[12]= " + fer[12];
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>