title: Pass object property through function parameter for if statement
body: <p>I have an array of objects.
  I need to create 1 function that returns a specific object key name for an if statement. I am currently attempting to do this like so:</p>
  
  <pre><code>&lt;button onclick="isClick('curly_hair')"&gt;&lt;u&gt;curly&lt;/u&gt;&lt;/button&gt;
  </code></pre>
  
  <p>Here is the function I am attempting:</p>
  
  <pre><code>function isClick(value) {
      for (i = 0; i &lt; People.length; i++) {
          if (People[i].options.value) {
  //do stuff
  }
  </code></pre>
  
  <p>Here is my array of Objects</p>
  
  <pre><code>var People = [
      {
          name: "Bill",
          img: "images/168-Cool-avatars/256x256_male-avatars_png/avatar-m-small-01.png",
          options: {
              curly_hair: false, long_hair: true, ...
          },
      },
  </code></pre>
  
  <p>To elaborate: Instead of needing to create an "if" statement for each of my "option" properties (curly_hair, long_hair, etc.) I am trying to pass this through the function parameter instead.
  If I pass "isClick(curly_hair)", I want to return all Objects within the Person array that has curly_hair: true.</p>