title: JS Iterate array of objects and replace values in string
body: <p>I have an array of javascript objects that I am working with. The keys are dynamically generated and there will be an unknown number of them.</p>
  
  <p>I am trying to loop over the object and replace a piece of data in its value.</p>
  
  <p>Here is an example below:</p>
  
  <pre><code>var obj = [{
      name: 'Joe',
      age: 21,
      randomCol1: 'Blah&lt;br&gt;Blah&lt;br&gt;Blah',
      randomCol2: 'Blah&lt;br&gt;Blah&lt;br&gt;Blah',
      randomCol3: 'Blah&lt;br&gt;Blah&lt;br&gt;Blah'
  },
  {
      name: 'Bob',
      age: 25,
      randomCol1: 'Blah&lt;br&gt;Blah&lt;br&gt;Blah',
      randomCol2: 'Blah&lt;br&gt;Blah&lt;br&gt;Blah',
      randomCol3: 'Blah&lt;br&gt;Blah&lt;br&gt;Blah'
  }]
  
  
  for (var key in obj) {
      if (obj.hasOwnProperty(key)) {
          obj[key].replace(/&lt;br&gt;/g,'\r\n')
      }
  }
  </code></pre>
  
  <p>In the object, I am trying to replace the <code>&lt;br&gt;</code> with <code>\r\n</code>. The column names are not always known. </p>
  
  <p>Should I be doing this through a loop or some type of mapping? Just needing to convert this data before passing it to an excel export where I need to utilize line breaks.</p>