title: is there any advice, to give value to key inside JQuery?
body: <p>Now I'm trying to use alert to find out the value of the variable before the format changed to words, then there is error message about the index number in the array. it said :uncaught SyntaxError : unexpected Number which is this line bulan 1 januari</p>
  
  <p>is there any advice, to give value to key in the array ?</p>
  
  <pre><code>$( function() {
  $( "#pickyDate" ).datepicker({format: "dd/mm/yyyy"});
  
  local = ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu' ];
  bulan = [1=&gt;'Januari', 'Februari', 'Maret', 'April', 'Mei',  'Juni','Juli','Agustus','September','Oktober','November','Desember' ];
  
  $('#getdate').datepicker()
  .on("change", function () {    
  
   var today = new Date($('#getdate').datepicker('getDate'));
   var tanggal = today.getDate();
   var no_hari = today.getDay();
   var no_bulan = today.getMonth()+1; 
   var tahun = today.getFullYear(); 
  
   //alert(local[today.getDay()]);
   alert(tahun);
   //$('#wordsdate').val(local[today.getDay()]);
  
  
  });
  });
  </code></pre>
  
  <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>$( function() {
  $( "#pickyDate" ).datepicker({format: "dd/mm/yyyy"});
  
  local = ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu' ];
  bulan = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni','Juli','Agustus','September','Oktober','November','Desember' ];
  
  $('#getdate').datepicker()
  .on("change", function () {    
  
   var today = new Date($('#getdate').datepicker('getDate'));
   var tanggal = today.getDate();
   var no_hari = today.getDay();
   var no_bulan = today.getMonth(); 
   var tahun = today.getFullYear(); 
     
     //alert(local[today.getDay()]);
   alert(tahun);
     //$('#wordsdate').val(local[today.getDay()]);
  
  
  });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css" rel="stylesheet" /&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"&gt;&lt;/script&gt;
  
  &lt;div class="form-group"&gt;
    &lt;input type="text" class="form-control" placeholder="choose date" id="getdate" /&gt;
  &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
    &lt;input type="hidden" class="form-control" placeholder="datepicker date" id="datenum" disabled/&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
    &lt;input type="text" class="form-control" placeholder="wordsdate" id="wordsdate" disabled/&gt;
    &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>example :<br>
  let say we choose a date : 05/06/2014<br>
  then result on textfield : the fifth of June Two thousand and fourteen</p>