title: JavaScript function that uses switch statement on the type of value
body: <p>I've been working with the JavaScript learning modules found in <strong><a href="http://www.codeacademy.com" rel="nofollow">CodeAcademy.com</a></strong> and find myself unredeemed in chapter 4, module 8 (switch - control flow statements)</p>
  
  <p>Please see below for example request:</p>
  
  <pre><code>// Write a function that uses switch statements on the
  // type of value. If it is a string, return 'str'. 
  // If it is a number, return 'num'. 
  // If it is an object, return 'obj'
  // If it is anything else, return 'other'.
  // compare with the value in each case using ===
  </code></pre>
  
  <p>and this is what I was able to code:</p>
  
  <pre><code>function StringTypeOf(value) {
  var value = true
  switch (true) {
   case string === 'string': 
     return "str"; 
     break;
   case number === 'number':
     return "num"; 
     break;
   case object === 'object':
     return "obj"; 
     break;
   default: return "other";
   }
    return value;
  }
  </code></pre>
  
  <p>Can someone please hint or tell me what is missing here?  </p>