Newer Version Available
Debugging
Use your browser’s console and JavaScript error messages generated within Salesforce to
debug Lightning pages built with the Lightning Console JavaScript API. The methods in the Lightning Console JavaScript APIs are asynchronous and return their results
using promises.
To print messages to your browser’s console, use console.log() in your component controller code.
Salesforce also displays JavaScript errors at runtime, which provide the stack trace when there’s a bug.