title: What is the contract of a function or variable in TypeScript
body: <p>I am a newbie at TypeScript and after installing it successfully on my machine, I came across the sentence "Type annotations in TypeScript are lightweight ways to record the intended contract of the function or variable" in TypeScript's official documentation page.</p>
  
  <p>What is the word <em>contract</em> explained in the context of a function or variable in TypeScript.</p>
  
  <p>The example that I took a look at was:</p>
  
  <pre><code>function greeter(person: string){
     return "Hello, " + person;
  }
  
  var user = "Jane User";
  
  document.body.innerHTML=greeter(user);
  </code></pre>
  
  <p>Is it something to do with string annotation attached with the function variable person?</p>
  
  <p>Any help on this is appreciated. </p>
  
  <p>Here is the link to the official <a href="http://www.typescriptlang.org/docs/tutorial.html" rel="nofollow">documentation</a></p>