title: Using a prompt() variable in a function
body: <p>In this code:</p>
  
  <pre><code>var ask = prompt("Enter contact's first name");
  
  function Contact(firstName, surname, age) {
      this.Name = firstName;
      this.Surname = surname;
      this.Age = age;
  }
  
  var contact = function (person) {
      for (var prop in person) {
          document.write(prop + ": " + person[prop] + "&lt;/br&gt;");
      }
  };
  
  var Alice = new Contact("Alice", "Example", 24);
  var Bob = new Contact("Bob", "Bobby", 39);
  
  
  contact(ask);
  </code></pre>
  
  <p>Why will it now work with the prompt box as the variable? It works fine when you just use a string in the contact function. Is it something to with because it is a variable not a string?</p>