title: Adding a Json Object after a particular Object in array in javascript
body: <p>I have an array of objects which looks like</p>
  <pre><code>arr = [
      {&quot;className&quot;:&quot;section&quot;, &quot;name&quot;:&quot;input&quot;},
      {&quot;className&quot;:&quot;col&quot;, &quot;name&quot;:&quot;dropdown&quot;},
      {&quot;className&quot;:&quot;section&quot;, &quot;name&quot;:&quot;table&quot;}
  ] 
  </code></pre>
  <p>Now I want to push an object <code>{&quot;fieldName&quot;:&quot;new&quot;}</code> after every object which has <code>&quot;className&quot;:&quot;section&quot;</code></p>
  <p>So my final output should look like something like this</p>
  <pre><code>arr = [
      {&quot;className&quot;:&quot;section&quot;, &quot;name&quot;:&quot;input&quot;},
      {&quot;fieldName&quot;:&quot;new&quot;},
      {&quot;className&quot;:&quot;col&quot;,&quot;name&quot;:&quot;dropdown&quot;},
      {&quot;className&quot;:&quot;section&quot;, &quot;name&quot;:&quot;table&quot;},
      {&quot;fieldName&quot;:&quot;new&quot;}]
  </code></pre>
  <p>How do I acheive this in Javascript?</p>