title: Receiving random img from array
body: <p>I can't get img from an array, I have an array with 6 variables that should be the path to the images, but the <code>console.log</code> at the end just gives me a random variable like sk11,sk15..... but they are not equal as paths to the images.</p>
  
  <pre><code>.controller('ArCtrl', function($scope) {
  
    var sk11,sk12,sk13,sk14,sk15,sk16;
    var kockice = ['sk11', 'sk12', 'sk13', 'sk14', 'sk15', 'sk16'];
  
    var rank = kockice[Math.floor(Math.random() * kockice.length)];
    //working good, finds random varibale in array
  
    if(rank === sk11) {
      sk11 = "http://localhost:8100/img/1.jpg";
      rank = sk11;
  
    } else if(rank === sk12) {
      sk12 = "http://localhost:8100/img/2.jpg";
      rank=sk12;
  
    } else if(rank === sk13) {
      sk13 = "http://localhost:8100/img/3.jpg";
      rank=sk13;
  
    }else if(rank === sk14) {
      sk14 = "http://localhost:8100/img/4.jpg";
      rank=sk14;
  
    }else if(rank === sk15) {
  
     sk15 = "http://localhost:8100/img/5.jpg";
     rank=sk15;
  
    } else if(rank === sk16){
     sk16 = "http://localhost:8100/img/6.jpg";
     rank=sk16;
    };
  
    console.log(rank); //gets back random from arry kockice
    console.log(sk11); //shows undefined?why
  </code></pre>