title: Uncaught ReferenceError: variable is not defined knuthShuffle
body: <p>I have a variable with images and I want to randomize the order of the images. I try to do this using <a href="https://github.com/coolaj86/knuth-shuffle" rel="nofollow">https://github.com/coolaj86/knuth-shuffle</a>. But when I use this code I get a "Uncaught ReferenceError: images is not defined "</p>
  
  <pre><code>(function () {
    'use strict';
  
    var images = [
      'dali.jpg',
      'illusionisme.png',
      'impresionisme.jpg',
      'popart.jpg',
      'abstracter.jpg',
      'abstrat.jpg',
      'concept.jpg',
      'fingerpaint.jpg',
      'flowers.jpg',
      'graffiti.jpg',
      'groovy.jpg',
      'skelly.jpg',
      'vangogh.jpg'
      ]
      , b
      ;
  
    // The shuffle modifies the original array
    // calling a.slice(0) creates a copy, which is assigned to b
    b = window.knuthShuffle(images.slice(0));
    console.log(b);
  }());
  </code></pre>
  
  <p>I use this code to pull random images from the variable.</p>
  
  <pre><code>$(".art").each(function(){
      $(this).prepend('&lt;img src="assets/images/' + images[Math.floor(Math.random() * images.length)] + '"&gt;');
  });
  </code></pre>