console.table
{id:1,name:‘WDE‘},
{id:2}
]
console.log(users)
output
|(index)|id|name|
|–|–|–|
|0|1|WDE|
|1|2||
console.time
estimate time complexity of a program in ms🤣
fetch(‘url‘).then(()=>{
//awaiting response
console.timeEnd(‘fetched‘) //fetched:0ms
})
console.dir
will display all property related to that datatype
name:‘aryan‘,
age:26
}
console.dir(obj);
output1
output2
console.trace
It will display call stack in decending order. last executed to firstly executed.
function boo(){
//do something
console.trace() // start tracing
}
boo();
}
// boo
// foo
// anonymous
console.assert
The console.assert() static method writes an error message to the console if the assertion is false. If the assertion is true, nothing happens.
ps: i dnot know use of this🤣
console.count
console.count(x);
}
//count the number of fun runs
fun(‘hi‘)
fun(‘hi‘)
fun(‘hi‘)
fun(‘hi‘)
output
clean the console.clear() 🤣
console.clear() // hey javascript clear all prev message
console.log(‘new messages aryan‘)
list in console.group()
output
step1:follow
step2:like
code
console.log(‘setp1:follow‘)
console.log(‘setp2:like‘)
console.groupEnd() //reset
post-credit:@code4git