title: Javascript arrays subtract a value from every element in array
body: <p>I have the following code written and I have no idea why it is not working. Essentially, I am trying to subtract 255 from every value in an array, but it <strong>must</strong> be ordered where 255 is first (I can't just do i - 255, it won't get me the values I need). I have also tried i+-255 to no avail.</p>
  
  <pre><code>function makeReverse(original, output){
    for (i=0; i&lt;original.length; i++) {
      output[i]=original[i]; //copy original array to output array
      if ((i % 4) !== 3) {
        output[i] = output[255 - i]; //why this is not working is beyond me the 
                                       values keep reading 0 for rgb
      }
    }
    console.log(output);
    return output;
  }
  </code></pre>