title: renaming key of json file
body: <p>I can change the value of key, but how can I rename json key by creating of function</p>
  
  <pre><code>    button.addEventListener("click", function(){
          var i = 0;
          i++;
          var name = "Jason " + i;
          var surname = "Carl " + i;
          writeJson(i, name, surname);
      });
  
      function writeJson(id, name, surname){
          var array = {
          id: {
              "name": name,
              "surname": surname
              }
          };
      }
  </code></pre>
  
  <p>in array id is not changing and i is not increasing</p>