title: How to change one property value in array with objects
body: <p>I have const tab where I want to change property isActive from boolean to 'on' or 'off' depending on if it's true or false.</p>
  <pre><code>   const tab = [
     {id:'0',original:{lineId:'4', isActive:false, length: '3'}},
     {id:'1',original:{lineId:'5', isActive:true, length: '4'}},
     {id:'2',original:{lineId:'6', isActive:false, length: '7'}}
    ];
  </code></pre>
  <p>I tried to use .map() but I do something wrong.
  Can You please suggest where is the issue ?</p>
  <pre><code>const newTab = tab.map(x =&gt; x.original.isActive === false ? 'off' : x.original.isActive === true ? 'on' : x);
  </code></pre>
  <p>This is how newTab should look like after change:</p>
  <pre><code>  const newTab = 
  [
      {id:'0',original:{lineId:'4', isActive:'off', length: '3'}},
        {id:'1',original:{lineId:'5', isActive:'on', length: '4'}},
        {id:'2',original:{lineId:'6', isActive:'off', length: '7'}}
       ];
  </code></pre>
  <p>With current code it returns changed isActive property only:</p>
  <pre><code>const newTab = [&quot;off&quot;, &quot;on&quot;, &quot;off&quot;]
  </code></pre>
  <p>thanks !</p>