How to replace first set null values and second set null values in an array
<p>Here is an array  </p>

<pre><code> var arr = [1,1,1,1,1,[xyz,abc,a],[xyz,abc,a],[xyz,abc,a],1,1,1,1,1];
 var p = 20;
 var y = 30;
</code></pre>

<p>I am trying to replace first set <code>1</code> series with decremented values of p from p to p-1, p-2..
And second set of <code>1</code>s till y with starting of 1<br>
My result array would be </p>

<pre><code> var arr = [16,17,18,19,20,[xyz,abc,a],[xyz,abc,a],[xyz,abc,a],1,2,3,4,5];
</code></pre>

<p>How can I achieve this.</p>
