title: JQuery year interval
body: <p>I get the data from localhost url. I have a variable called "DateRequest". I only want to take years between 1900 and 2030 for this variable. I wrote a code like this, but it does not work. How can I fix?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> &lt;script type="text/javascript"&gt;
          document.body.style.backgroundColor = "#6e7b8b";
  
          $.get("http://localhost:8080/request",
                 function (data, status) {
                     var year = {}
                     var yearrequestnum = [];
  
                     $.each(data, function (index, item) {
  
                         var girisYear = null;
                         if (item.DateRequest != null &amp;&amp; item.DateRequest.length &gt; 4)
                         {
                             girisYear = item.DateRequest.substr(0, 4);
  
                             if (yil[girisYear] == null) {
                                 yil[girisYear] = 0;
                             }
                             yil[girisYear]++;
                         }
                     });
                     console.log(yil);
  
                     $.each(year, function (index, item) {
                         console.log(parseInt(index, 0));
                         if (parseInt(index, 0) &lt; 1900 &amp;&amp; parseInt(index, 0) &gt; 2030)
                             return;
                         newitem = {}
                         newitem["girisYili"] = index
                         newitem["sayi"] = item;
                         yearrequestnum.push(newitem);
                     });
  
                     console.log(yearrequestnum)</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;script src="https://www.amcharts.com/lib/3/amcharts.js"&gt;&lt;/script&gt;
      &lt;script src="https://www.amcharts.com/lib/3/pie.js"&gt;&lt;/script&gt;
      &lt;script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://www.amcharts.com/lib/3/amcharts.js"&gt;&lt;/script&gt;
      &lt;script src="https://www.amcharts.com/lib/3/pie.js"&gt;&lt;/script&gt;
      &lt;script src="https://www.amcharts.com/lib/3/serial.js"&gt;&lt;/script&gt;
        &lt;script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" /&gt;
      &lt;link rel="shortcut icon" href=""&gt;
      &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>