title: What's the best way to debug Javascript/AngularJS?
body: <p>I just started learning Javascript and AngularJS and have a decent Java and C++ background.
  Today I wasted an entire day debugging a trivial error that boiled down to a missing comma in a JSON file: <code>"name": "Melbourne", 
  "snippet": "Melbourne"
  "location":{"lat": "37.8136S", "long": "144.9631E"}</code></p>
  
  <p>Now I'm wondering:
  <strong>What's the Javascript/AngularJS way of debugging?</strong> - for this specific case as well as in general. Spending 8 hours changing every line in the code can't be the solution.
  In C++/Java I would look at the stacktrace so i checked the chrome console output and found:</p>
  
  <pre><code>SyntaxError: Unexpected string
  at Object.parse (native)
  at fromJson (http://localhost:8000/app/bower_components/angular/angular.js:1078:14)
  at $HttpProvider.defaults.defaults.transformResponse (http://localhost:8000/app/bower_components/angular/angular.js:7317:18)
  at http://localhost:8000/app/bower_components/angular/angular.js:7292:12
  at Array.forEach (native)
  at forEach (http://localhost:8000/app/bower_components/angular/angular.js:323:11)
  at transformData (http://localhost:8000/app/bower_components/angular/angular.js:7291:3)
  at transformResponse (http://localhost:8000/app/bower_components/angular/angular.js:7963:17)
  at wrappedCallback (http://localhost:8000/app/bower_components/angular/angular.js:11319:81)
  at http://localhost:8000/app/bower_components/angular/angular.js:11405:26 angular.js:9778
  </code></pre>
  
  <p>How is this supposed to help me? I see nothing that even remotely tells me to check my JSON or my code - only library code. The offending lines in my code are</p>
  
  <p>//citycontroller.js</p>
  
  <pre><code>$scope.cities= City.query();
  </code></pre>
  
  <p>//cityservice.js</p>
  
  <pre><code>cityServices.factory('City', ['$resource',
  function($resource){
  return $resource('cities/:cityId.json', {}, {
    query: {method:'GET', params:{cityId:'cities'}, isArray:true}
  });
  }]);
  </code></pre>
  
  <p>Why isn't there a stacktrace for either of these lines?</p>