title: uncaught typeerror cannot read property '0' of undefined Javascript
body: <p>here is part of my function code that makes an error on javascript error console ( Google Chrome)</p>
  
  <pre><code>function premuto(x){
          if(x.Clickable){
                  x.Selected = !x.Selected;
              if (x.Selected){
                  x.style.backgroundColor ='lightblue';
                  y = document.getElementById('spazio');
                  y.innerHTML = y.innerHTML + x.innerHTML;
                  sequenza[indice] = x.Number;
                  indice++;
              }
  </code></pre>
  
  <p>error compares at line "sequenza[indice] = x.Number;"</p>
  
  <p>What's wrong?</p>
  
  <p>Thanks</p>