examine the state of variables and contexts within our program.
One of the easiest ways to insert a breakpoint is the codding of the "debugger" statement. When
reached and the debugger is available, debugging will occur.
Logging to the browser console
Within the JavaScript that runs in the browser, an object called "console" is available. Using this
object, one can log data to the browser's console.
The following are available:
Function Chrome IE Firefox
assert
Y
clear
Y
count
Y
debug
Y
dir
Y
dirxml
Y
error
Y
group
Y
groupCollapsed
Y
groupEnd
Y
info
Y
log
Y
profile
Y
profileEnd
Y
time
Y
timeEnd
Y
timeStamp
Y
trace
Y
warn
Y
console.debug
This method is a synonym for console.log.
See also:
• console.log
• console.error
• console.info
• console.warn
console.error
This method is the same as console.log with the addition that the stack trace of where the error
occurred is also written.
Page 134
Comentarios a estos manuales