title: telling a variable to access an array for an if statement
body: <p>I am programming an online experiment using jspsych/javascript. The experiment consists of 100 blocks and after each block, the block_number gets updated by +1. 
  There are two conditions. On 75 blocks, I want the program to show an image, and on 25 blocks, I want the program to show a letter. 
  First, I generated 25 random numbers (that will serve as 25 block numbers), on which the letter should be shown. My problem is to tell the program to use these 25 numbers as block_number for the letter condition, but use the other block numbers as block_number for the image condition. 
  Maybe I need to store the 25 numbers in a different format, that is, they are not stored as an array? Also in the if statement, how to "connect" block_number to these 25 numbers? 
  Please see my code below. Thank you so much for your help, I really appreciate it!  </p>
  
  <p>// initialize block_number at the very beginning, it gets updated +1 after the for loop:</p>
  
  <pre><code>var block_number = 0;
  </code></pre>
  
  <p>// there are 100 blocks in total, and on 25 of them (picked randomly at the 
  very beginning), a letter instead of an image should be shown:</p>
  
  <pre><code>var random_numbers = Array.from(Array(95), (x, index) =&gt; index + 5);
  random_numbers = jsPsych.randomization.shuffle(random_numbers);
  var block_keys = random_numbers.filter((random_numbers,idx) =&gt; idx &lt; 25);
  block_keys.sort();
  </code></pre>
  
  <p>// in the if statement, I want to show letters only when block_number is equal to block_keys, otherwise, images should be shown:</p>
  
  <pre><code>  if (block_number == block_keys) {
      show letter
    } else {
      show image
    }
  </code></pre>