title: map 2 array of object and populate boolean array
body: <p>I have this first array, at the end of each item it has numerical value.</p>
  
  <pre><code>const arr = ["abc#1","def#2","z#1", "z#2"]
  </code></pre>
  
  <p>I have to map it with below array</p>
  
  <pre><code>const arrObj = [{
    name: 'abc'
  },{
    name: 'def'
  },{
    name: 'z'
  }]
  </code></pre>
  
  <p>to populate a new property value that has boolean in array</p>
  
  <pre><code>result = [{
    name: 'abc',
    value: [true, false]
  },{
    name: 'def',
    value: [false, true]
  },{
    name: 'z',
    value: [true, true]
  }]
  </code></pre>
  
  <p>I'm stuck at doing multiple iteration but failed to produce above result.</p>
  
  <pre><code>const arr = ["abc#1","def#2","z#1", "z#2"]
  
  let arrObj = [{
    name: 'abc'
  },{
    name: 'def'
  },{
        name: 'z'
      }]
  
  const raw = arr.map(o =&gt; o.split('#')[0])
  const key = arr.map(o =&gt; o.split('#')[1])
  
  arrObj = arrObj.map(o =&gt; {
  
    console.log('raw', raw)
  
    if(raw.includes(o.name)) {
      console.log('key', key)
      console.log(o.name)
    }
  
    return {
      ...o,
      value: []
    }
  })
  </code></pre>