title: Check for duplicate then increment the duplicate value by 1
body: <p>I want to check the duplicate then if match increment the value by 1, but if the input is 0 disregard it. I want to start the increment in 1 not on 0. The processed on checking the duplicate value was ok. </p>
  
  <p>Now the problem is I don't want to increment if the value is 0 it will retain as 0 value, I want to start to increment on value 1.</p>
  
  <pre><code>getDuplicateHierarchy: function() {
      var $this = this;
      var input = []
      var match = false;
  
      $.each($('.duplicate'), function(index, value) {
               input.push(this.value);
  
          for (i = 0; i &lt; input.length; i++) 
          {
               for (j = 0; j &lt; input.length; j++) 
               {
                    if(input[i] == input[j])
                    {
                         if( i != j)
                         {
                         match = true;
                         }
                    }
               }
          }
  
          if(match)
          {
               $(value).parent().append('&lt;div class="validation-duplicateHierarchy-error"&gt;Duplicate.&lt;/div&gt;');
               $this.isValidHierarchy = false;
          }
      });
      return $this.isValidHierarchy;
  },
  </code></pre>