title: basic javascript object and mime regarding a basic web-server code
body: <p>i am new to programming with javascript. and i picked angular + node.js for server side.
  i went through the angular tutorial and i have a few question regarding the web-server.js they gave. as the server part is not covered in the angular tutorial i have some questions:</p>
  
  <p>the server is ran with this command line:</p>
  
  <pre><code>node ./scripts/web-server.js
  </code></pre>
  
  <p>the main function that is being executed is "main" it is done via:
  main(process.argv);</p>
  
  <p>and the function is:</p>
  
  <pre><code>function main(argv) {
    new HttpServer({
      'GET': createServlet(StaticServlet),
      'HEAD': createServlet(StaticServlet)
    }).start(Number(argv[2]) || DEFAULT_PORT);
  }
  
  function HttpServer(handlers) {
    this.handlers = handlers;
    this.server = http.createServer(this.handleRequest_.bind(this));
  }
  
  function createServlet(Class) {
    var servlet = new Class();
    return servlet.handleRequest.bind(servlet);
  }
  
  function StaticServlet() {}
  
  StaticServlet.MimeMap = {
    'txt': 'text/plain',
    'html': 'text/html',
    'css': 'text/css',
    'xml': 'application/xml',
    'json': 'application/json',
    'js': 'application/javascript',
    'jpg': 'image/jpeg',
    'jpeg': 'image/jpeg',
    'gif': 'image/gif',
    'png': 'image/png',
    'svg': 'image/svg+xml'
  };
  </code></pre>
  
  <p>my questions:</p>
  
  <pre><code>{    'GET': createServlet(StaticServlet),
      'HEAD': createServlet(StaticServlet)
    }
  </code></pre>
  
  <p>i do not understand what these lines do. i assume this line creates an object, but the way that i know would be more like</p>
  
  <pre><code>{
      GET: createServlet(StaticServlet),
      HEAD: createServlet(StaticServlet)
    }
  </code></pre>
  
  <p>what does the ' ' mean in those lines?</p>
  
  <p>second question:
  what does these means?</p>
  
  <pre><code>.start(Number(argv[2]) || DEFAULT_PORT);
  </code></pre>
  
  <p>the .start functon is:</p>
  
  <pre><code>HttpServer.prototype.start = function(port) {
    this.port = port;
    this.server.listen(port);
    util.puts('Http Server running at http://localhost:' + port + '/');
  };
  </code></pre>
  
  <p>but i dont understand why is the || and argv[2] is actually null so why do we need to pass it.</p>
  
  <p>third question:
  is regarding the creation of the StaticServlet.MimeMap.
  it is very similar to my first question i think. i do not understand the syntax here:</p>
  
  <pre><code>'txt': 'text/plain',.
  </code></pre>
  
  <p>what does it create?</p>