console
2021.12.22
console in JavaScript
#JavaScript#basics
use client /components/post/reExport ,
date: ,
tags: [ ],
imgUrl: ,
desc: ,
body: (
<>
<H>Console</H>
<Code block jsx>{ ) // writes an error message to the console if the assertion is false
console.clear() // clears the console if the environment allows
console.count( ) // logs the number of this count() calls has been called
console.countReset( ) // resets counter used with console.count()
console.error( ) // outputs an error message
console.info( ) // outputs an informational message
console.warn( ) // outputs a warning message
console.table(objOrArr) // displays tabular data as a table
console.trace(objOrMsg) // outputs a stack trace
console.time(timerName) // starts a timer
console.timeLog(timerName) // logs the current value of a timer
console.timeEnd(timerEnd) // stops a timer
a: { b: { c: [Object] } } console.dir(obj, { depth: null })
console.dir({
a: {
b: {
c: {
d: {
e: {},
},
},
},
},
}, { depth: null })