Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What's the use of Console Api?

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the use of Console Api, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

All Console Api

Console.dir (console)

Display simple information

Console.log ('hello world')

Console.info ('Information')

Console.error ('error')

Console.warn ('warning')

Placeholder

Console.log ('% dmurt% dmurt% dmae1% scurijimi 2016, 08pr 21 'Chinese women's volleyball team won the championship!')

Count the number of code execution

Function getInfo ()

{

Console.count ('number of execution:')

}

GetInfo ()

GetInfo ()

GetInfo ()

GetInfo ()

Display grouping information

Console.group ("first set of messages")

Console.log ('Group 1: custom message 1')

Console.log ('Group 1: custom message 2')

Console.log ('Group 1: custom message 3')

Console.groupEnd ()

Console.group ("second set of information")

Console.log ('Group 2: custom message 1')

Console.log ('Group 2: custom message 2')

Console.log ('Group 2: custom message 3')

Console.groupEnd ()

Display object information

Var TomObj = {

Name: "Tom"

Sex: "male"

Age: '31'

Hobby: "coding..."

}

Console.dir (TomObj)

Display page information

Console api

Var info = document.getElementById ('console')

Console.dirxml (info)

Determine whether an expression or variable is true

Var code = 200

Console.assert (code)

Console.assert (code = 200)

Console.assert (code = = 500)

Trace the call trajectory of a function

Function add (a _ r _ b) {

Console.trace ()

Return a + b

}

Add (1 dint 2)

Add (2pr 3)

Add (3pr 4)

Timing function

Console.time (console timer)

Console.log ('Start')

For (var iTuno Bandi)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report