title: React JS Uncaught Reference Error: function not defined
body: <p>I am trying to call shuffleCards when the upon a click event in a ReactJs component. However, I am receiving the following error: </p>
  
  <pre><code>Uncaught ReferenceError: shuffleCards is not defined
  </code></pre>
  
  <p>Here's my code:</p>
  
  <pre><code>constructor(props) {
      super(props);
  
      this.state = {
          count: 0
      };
  }
  
  shuffleCards(array) {
      var i = array.length,
          j = 0,
          temp;
  
      while (i--) {
          j = Math.floor(Math.random() * (i+1));
  
          temp = array[i];
          array[i] = array[j];
          array[j] = temp;
      }
      return array;
  }
  
  handleClickEvent(event) {
      var cards = [
          {txt: "A",
          isDisplayed: false},
          {txt: "B",
          isDisplayed: false},
          {txt: "C",
          isDisplayed: false}
      ];
      if (this.state.count == 0) {
          cards = shuffleCards(cards);
      }
  
  }
  </code></pre>