title: Loop appears to end, even though expectation is to reset
body: <p>I have an object:</p>
  
  <pre><code>var $neutrals = [
      {label : "Neutrals 1", value : "#ffffff", type : "color"},
      {label : "Neutrals 2", value : "#f8f8f8", type : "color"},
      {label : "Neutrals 3", value : "#d9d9d9", type : "color"},
      {label : "Neutrals 4", value : "#b2b3b7", type : "color"},
      {label : "Neutrals 5", value : "#5b5e65", type : "color"},
      {label : "Neutrals 6", value : "#151618", type : "color"}
  ];
  </code></pre>
  
  <p>Within this object, I'm looking to loop through each element to then compare each color with each other to make sure that that pair passes a certain luminance level. Here is my code:</p>
  
  <pre><code>function create_colors(){
      var neutral_set = $("&lt;div/&gt;").addClass("color-set");
      $(".color-container").html(neutral_set);
      neutral_set.append("&lt;h3&gt;Neutrals&lt;/h3&gt;");
  
      $.each($neutrals, function(){
          var parent_color = this.value;
  
          var colorstrip = $("&lt;div/&gt;").addClass("color-strip").attr("style", "background-color:"+parent_color+";");
  
          neutral_set.append(colorstrip);
  
          $.each($neutrals, function(){
              var overlay = hexToRgb(this.value);
              var base = hexToRgb(parent_color)
  
              var diff_contrast = contrast(base, overlay);
              console.log(this.value+", "+parent_color);
  
              if(diff_contrast &gt; 4.5)
              {
                  colorstrip.append("&lt;span style='color:"+this.value+"'&gt;"+this.label+", "+diff_contrast+"&lt;/span&gt;");
                  return false;
              }
          })
      });
  }
  </code></pre>
  
  <p>The output appears like so:
  <a href="https://i.stack.imgur.com/9QFiY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9QFiY.png" alt="enter image description here"></a></p>
  
  <p>This is close to what I expected it to be, where all the lighter colors show the lowest to pass the 4.5:1 contrast ratio, while the darker gray and blacks are empty without showing, from my experience, the white <code>#ffffff</code>. Is it that I'm stopping the loop with a return false that's stopping the loop from continuing? I'm not entirely sure what I did wrong here.</p>