title: Solution to jshint "Better written in dot notation" when i have valid use of non-dot notation
body: <p>How does one use dot notation when i'm provided a string?</p>
  
  <p>I am writing some code to populate an angular 'x-editable' type of control.  I have an array of values predefined with a string identifier based on what my webapi service will pass back to me. It sends back a string.  Based on this string, i choose the object from the array i have pre-defined using the following method:</p>
  
  <pre><code>valuetoshow = myarray['stringFromWebApiCall'];
  </code></pre>
  
  <p>JSHINT is throwing a fit because it wants me to use dot notation. I understand WHY JSHINT is telling me this, and also I understand which lines it is telling me about, and I know if I change my code to something like "answers.undergraduate = bigarray" it will fix the jshint.  <strong>I just don't know what to do about accessing the array using .notation when i'm provided a string in the code below.</strong> </p>
  
  <p>Is there some sort of method in javascript that lets me use a string to look up something in dot notation?  I'm used to C# and this quasi-typed odd defining of variables it proving tricky for me to wrap my head around.</p>
  
  <ul>
  <li><code>['UNDERGRADUATE'] is better written in dot notation.</code></li>
  <li><code>['GRADUATE'] is better written in dot notation.</code></li>
  <li><code>['HONORARY'] is better written in dot notation.</code></li>
  <li><code>['DOCTORATE'] is better written in dot notation.</code></li>
  <li><code>['MASTERS'] is better written in dot notation.</code></li>
  <li><code>['UNDEFINED'] is better written in dot notation.</code></li>
  </ul>
  
  <p>Should i attempt to suppress the error?  Should I just write a big ugly switch statement on the api results?</p>
  
  <p>Here is the real code </p>
  
  <pre><code>    answers['UNDERGRADUATE'] = [
        { 'name': 'Find a job', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Create a network with STTI members', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Receive nursing guidance', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Learn and grow through online continuing nursing education', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false }
      ];
  
      answers['GRADUATE'] = [
        { 'name': 'Find a job', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Expand your network with STTI members', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Grow your portfolio', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Develop advanced leadership skills', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Stay current on nursing trends', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Learn and grow through online continuing nursing education', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false }
      ];
  
      answers['NURSE LEADER'] = [
        { 'name': 'Find a job', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Expand your network with STTI members', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Grow your portfolio', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Develop advanced leadership skills', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Stay current on nursing trends', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Learn and grow through online continuing nursing education', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false }
      ];
  
      answers['HONORARY'] = [
        { 'name': 'Find a job', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Expand your network with STTI members', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Grow your portfolio', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Develop advanced leadership skills', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Stay current on nursing trends', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Learn and grow through online continuing nursing education', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false }
      ];
  
      answers['DOCTORATE'] = [
        { 'name': 'Find a job', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Expand your network with STTI members', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Grow your portfolio', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Develop advanced leadership skills', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Stay current on nursing trends', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Learn and grow through online continuing nursing education', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false }
      ];
  
      answers['MASTERS'] = [
        { 'name': 'Find a job', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Expand your network with STTI members', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Grow your portfolio', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Develop advanced leadership skills', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Stay current on nursing trends', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Learn and grow through online continuing nursing education', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false }
      ];
  
      answers['UNDEFINED'] = [
        { 'name': 'Find a job', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Expand your network with STTI members', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Grow your portfolio', 'ticked': false, 'hideThisGroup':false, 'checkboxDisabled': false },
        { 'name': 'Develop advanced leadership skills', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Stay current on nursing trends', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false },
        { 'name': 'Learn and grow through online continuing nursing education', 'ticked': false, 'hideThisGroup':true, 'checkboxDisabled': false }
      ];
  
      if ($rootScope.constituent != undefined){
          if ($rootScope.constituent.InductedAs != undefined) {
              $scope.constituentPriorities = answers[$rootScope.constituent.InductedAs.toUpperCase()];
          } else {
              $scope.constituentPriorities = answers['UNDEFINED'];
          }   
      }
  </code></pre>