title: Array Map using JS - Compare values to another array and return value from second array
body: <p>I'd like to map this table's <code>chapter_id</code> and <code>brother_id</code> with the brothers and chapters table below and return the <code>brothername</code> and <code>name</code> field's respectively. Using js or jquery. I am using vuejs returning minutes array as a computed property. See below.</p>
  
  <p>In <code>sql</code> it's be something like </p>
  
  <blockquote>
    <p><code>select brothername from brothers where minute.brother_id = brothers.id</code> ... and then set the brothername as the new value for <code>brother_id</code> </p>
  </blockquote>
  
  <p>same thing goes for <code>chapter_id</code>: </p>
  
  <blockquote>
    <p><code>select brothername from brothers where minute.brother_id = brothers.id</code> ... and then set the brothername as the new value for <code>brother_id</code> </p>
  </blockquote>
  
  <p>the resulting array or object should be:</p>
  
  Expected Array
  
  <pre><code>[
     {
        "location":"UCLA",
        "chapter_id":"Beta", 
        "brother_id":"Golpher", 
        "created_at":"2008-05-15 22:23:00",
        "status":"Approved"
     },
     { ... },
     {
        "location":"John's Deli",
        "chapter_id":"Beta", notice the change in the array based on the ids
        "brother_id":"Sheera", notice the change in the array based on the ids
        "created_at":"2008-05-15 22:23:00",
        "status":"Approved"
     }
  ]
  </code></pre>
  
  Minutes Table <em>(original array)</em>
  
  <pre><code>[
     {
        "location":"UCLA",
        "chapter_id":2,
        "brother_id":1,
        "created_at":"2008-05-15 22:23:00",
        "status":"Approved"
     },
     { ... },
     {
        "location":"John's Deli",
        "chapter_id":2,
        "brother_id":4,
        "created_at":"2008-05-15 22:23:00",
        "status":"Approved"
     }
  ]
  </code></pre>
  
  Chapter's Table
  
  <pre><code>[
     {
        "id":1,
        "letter_representation":"A",
        "name":"Alpha",
        "founded_at":"UCLA",
        ...
     },
     { ... }
  ]
  </code></pre>
  
  Brother's Table
  
  <pre><code>[
     {
        "id":1,
        "profile_id":1,
        "chapter_id":1,
        "brothername":"Golpher",
        "firstname":"Jack",
        ...
     },
     { ... },
     {
        "id":4,
        "profile_id":4,
        "chapter_id":1,
        "brothername":"Sheera",
        "firstname":"Jake",
        ...
     }
  ]
  </code></pre>
  
  Vue.js
  
  <pre><code>computed: {
      brothers () {
          return this.$store.state.brothers
      },
      chapters () {
          return this.$store.state.chapters
      },
      minutes () {
          return this.$store.getters.model
      }
  },
  </code></pre>