Empty element is added to Object
<p>I create an object from <code>duplicates</code> array and I dynamically push to it elements. Everything works fine, excepting that I'm getting an additional empty element and I can't figure it out why...</p>

<p>This is my code:</p>

<pre><code>for(i=0;i&lt;duplicates.length; i++) {
  Logger.log(duplicates[i]);
  var request = {
    "name": duplicates[i].scope,
    "id": 3,
    "rules":[
      {
        "name": duplicates[i].scope + " " + "OP SDR Sync",
        "tags": [
          {
            "tagId": 1,
            "variables":[
              {
              }
            ],
            "condition": false,
          },
          {
            "tagId": 1,
            "condition": false,
          }
        ],
        "ruleSetId": 3,
      }
    ]
  }

  for(var j in duplicates[i].variable) {
    request.rules[0].tags[0].variables.push({
      "variable": duplicates[i].variable[j],
      "matchType": "Regex",
      "value": duplicates[i].scopeDef
    });
  }
}
</code></pre>

<p>Here is an example:</p>

<p><code>duplicates</code> = <code>[
{scopeDef=.*, scope=Global 4, variable=[trackingcode, v1, v2]}, {scopeDef=https://www.delta.com/, scope=Homepage 2, variable=[v4, v5, v6, v7]}, 
]</code></p>

<p>After I execute the code I get the following log:</p>

<p>First object</p>

<pre><code>{name=Global 4, rules=[{name=Global 4 OP SDR Sync, tags=[{variables=[
{}, 
{matchType=Regex, variable=trackingcode, value=.*}, 
{matchType=Regex, variable=v1, value=.*}, 
{matchType=Regex, variable=v2, value=.*}], condition=false, tagId=1.0}, {condition=false, tagId=1.0}], ruleSetId=3.0}], id=3.0}
</code></pre>

<p>Second object</p>

<pre><code>name=Homepage 2, rules=[{name=Homepage 2 OP SDR Sync, tags=[{variables=[
{}, 
{matchType=Regex, variable=v4, value=https://www.delta.com/}, 
{matchType=Regex, variable=v5, value=https://www.delta.com/}, 
{matchType=Regex, variable=v6, value=https://www.delta.com/}, 
{matchType=Regex, variable=v7, value=https://www.delta.com/}], condition=false, tagId=1.0}, {condition=false, tagId=1.0}], ruleSetId=3.0}], id=3.0}
</code></pre>

<p>Note that both objects contain an empty element...why is that element added and how can I get rid of it??</p>