当前位置:网站首页>Console you don't know
Console you don't know
2022-06-11 09:01:00 【yyyyan_】
What you don't know console
Front end learning , Almost the first thing to learn is console.log() .
After all, most people's first line of code is :console.log("Hello World!") ;
console Object provides access to the browser debugging console , You can access... From any global object console object .
Flexible use of console Object , Can make development easier .
The most common console method
console.log()- General method of printing content .
console.info()- Print information description information .
console.debug()- Print a message on the console "debug" Level messages .
console.warn()- Print a warning message .
console.error()- Print an error message .

console.log() Write css

console.log() Using parameter

console.clear()
Used to clear console information 
console.count(label)
Output count() Number of calls , You can use a parameter label. The demonstration is as follows :
var user = "";
function greet() {
console.count(user);
return "hi " + user;
}
user = "bob";
greet();
user = "alice";
greet();
greet();
console.count("alice");
Output 
console.dir()
Use console.dir() You can print the properties of the object , View the details of the object level by level in the console .
console.memory
console.memory Is an attribute , Not the way , Use memory Property is used to check memory information .
console.time() and console.timeEnd()
console.time()- Start the timer with the name of the input parameter . You can run up to... Simultaneously on a given page 10000 Timers .console.timeEnd()- Stop the specified timer and record the time elapsed since startup ( In Milliseconds ).

console.assert()
If the assertion is false , Write error messages to the console , If it is true , No display .
console.trace()
console.trace() Method to output the stack trace to the console .
console.table()
stay console You can also print forms 

Print Html Elements

console.group() and console.groupEnd()
Create a new group on the console , Then the output to the console will be added to an indent , Indicates that the content belongs to the current group , Until the call console.groupEnd() after , End of current grouping .
边栏推荐
- [C language - function stack frame] analyze the whole process of function call from the perspective of disassembly
- SAP ODATA 开发教程
- 【237. 删除链表中的节点】
- vagrant 安装踩坑
- Mazhiqiang: research progress and application of speech recognition technology -- RTC dev Meetup
- 876. 链表的中间结点
- [C language - Advanced pointer] mining deeper knowledge of pointer
- c的printf相关
- 2095. delete the intermediate node of the linked list
- Flutter development log - route management
猜你喜欢

(1) AAC opening - lifecycle, livedata, ViewModel and source code analysis skills of core component principles (Reprint)
![[C language - data storage] how is data stored in memory?](/img/cb/2d0cc83fd77de7179a9c45655c1a2d.png)
[C language - data storage] how is data stored in memory?
![[C language - function stack frame] analyze the whole process of function call from the perspective of disassembly](/img/c5/40ea5571f187e525b2310812ff2af8.png)
[C language - function stack frame] analyze the whole process of function call from the perspective of disassembly

C语言打印菱形

Complexity analysis of matrix inversion operation (complexity analysis of inverse matrix)

使用express+mysql创建一个基于nodejs的后台服务

C language printing diamond

The interviewer asked four questions and summed up four experiences

c语言打印心形

How to apply for BS 476-7 sample for display? Is it the same as the display
随机推荐
GCC AVR (ATMEL studio+ AVR studio) how to define the structure array in the program memory (flash) space and read it
MSF给正常程序添加后门
【智能开发】血压计方案设计与硬件开发
multiplication table
BS 7176 fire resistance test for upholstered furniture
Screening frog log file analyzer Chinese version installation tutorial
小型制氧机解决方案PCBA电路板开发
How to apply for BS 476-7 sample for display? Is it the same as the display
SAP ABAP field symbol
Is it appropriate to apply silicone paint to American Standard UL 790 class a?
Erreur de démarrage MySQL "BIND on TCP / IP Port: Address already in use"
Sword finger offer 18 Delete the node of the linked list
openstack详解(二十四)——Neutron服务注册
领导让我重写测试代码,我也要照办嘛?
Port occupancy problem, 10000 ports
206. reverse linked list
K8s application (IV) - build a redis5 cluster (for direct external access)
Matlab learning 9- nonlinear sharpening filter for image processing
【新手上路常见问答】关于数据可视化
山东大学增强现实实验四