The console provides the following useful commands:
assert
- A simple assertion API to verify functionalitytime
and timeEnd
- Measure how long something takestimeStamp
- Programatically mark the timeline.debugger
- Force the debugger to breakprofile
and profileEnd
- Programatically start and stop a CPU profileconsole.assert($('#my-component').length, "My component exists on the page");
console.time("ajax request");
$.get('/some/url', function() {
// Will print to the screen the
// elapsed time between start and end
console.timeEnd("ajax request");
});
function removeCalendar() {
console.timeStamp("removing calendar");
calendarElement.remove();
calendarDisplayed = false;
}