Found 2416 Articles for HTML

HTML DOM console.timeEnd() Method

AmitDiwan
Updated on 13-Aug-2019 08:45:10

25 Views

The console.timeEnd() method is used for stopping the timer and displaying the time elapsed while the code inside the console.time() and console.timeEnd() took to finish execution. It is useful for timing sections of your code to figure out where the bottlenecks are. Using the optional label parameter we can specify which timer to stop.SyntaxFollowing is the syntax for console.timeEnd() method −console.timeEnd(label);Here, label is an optional parameter for specifying which timer to stop.ExampleLet us look at an example for the console.timeEnd() method − console.time() Method Click the below button to time the for, while and do-while loops for 100000 ... Read More

HTML DOM console.time() Method

AmitDiwan
Updated on 13-Aug-2019 09:08:40

30 Views

The HTML DOM console.time() method is used for displaying the time elapsed in executing a piece of code. This helps us in analyzing the entire code or specific bits of our code. By timing your code you can make it more efficient. Using the optional label parameter you can create several timers on the same page.SyntaxFollowing is the syntax for HTML DOM console.time() method −console.time(label)Here, the label is an optional parameter to give our timer a name.ExampleLet us look at an example for the console.time() method − console.time() Method Click the below button to time the for, while ... Read More

HTML DOM console.table() Method

AmitDiwan
Updated on 08-Aug-2019 12:27:07

147 Views

The HTML DOM console.table() method is used to display data in a well organized tabular format. This method can be used to visualize complex arrays or objects. The table is organized in such a way that each element in the array will be a row in the table. It takes two parameters tabledata(compulsory) and tablecolumns(optional).SyntaxFollowing is the syntax for the console.table() method −console.table( tabledata, tablecolumns );Here −Tabledata is a compulsory parameter value. It represents the data to be used in filling the table. It can be of type object or an array.Tablecolumns is an optional parameter value.It is an array ... Read More

HTML DOM console.log() Method

AmitDiwan
Updated on 08-Aug-2019 12:23:54

4K+ Views

The HTML DOM console.log() method is used for writing a message to the console. The console is used for debugging and testing purposes mainly. The message can be a string type or an object type.SyntaxFollowing is the syntax for the console.log method −onsole.log(msg)Here, msg can be a string, array or object. We can send multiple comma separated objects as parameter too.ExampleLet us look at an example for the console.log() method − JavaScript console.log() Method Press F12 key to view the message in the console view. LOG    function logConsole(){       console.log("Following are some animal names"); ... Read More

HTML DOM console.info() Method

AmitDiwan
Updated on 20-Feb-2021 05:46:12

16 Views

The HTML DOM console.info() method is used to write an informational message to the console. This method is useful for debugging and testing purposes. Some browsers e.g: firefox, chrome display a small i icon in blue color for the statements printed using this method.SyntaxFollowing is the syntax for the HTML DOM console.info() method −console.info( message )Here, the message is a required parameter and can be of type string or object. It is displayed in the console.ExampleLet us see an example for the HTML DOM console.info() method −Live Demo console.info() Method Press F12 key to view the message in ... Read More

HTML DOM console.groupEnd() Method

AmitDiwan
Updated on 08-Aug-2019 12:13:03

37 Views

The HTML DOM console.groupEnd() method is used for indicating the end of a message group. It exits the current message group in the console.SyntaxFollwing is the syntax for console.groupEnd() method −console.groupEnd()ExampleLet us see an example for the HTML DOM console.groupEnd() method − console.groupEnd() Method Press F12 key to view the message in the console view. GROUP END GROUP    function groupMessage(){       console.group();       console.log("This message will be inside a group!");       console.log("This message will also be inside a group!");    }    function EndGroup(){       console.groupEnd();     ... Read More

HTML DOM console.groupCollapsed() Method

AmitDiwan
Updated on 08-Aug-2019 12:09:02

43 Views

The HTML DOM console.groupCollapsed() method specifies the beginning of a collapsed message group.SyntaxFollowing is the syntax −console.groupCollapsed(label)Here, label is the label for the group.ExampleLet us look at an example for the console.groupCollapsed() method − console.groupCollapsed() Method Press F12 key to view the message in the console view.

HTML DOM console.group() Method

AmitDiwan
Updated on 13-Aug-2019 09:03:19

58 Views

The HTML DOM console.group() method is used to indicate the start of message group and all messages written after this method will be written inside the message group. This allows making one group for all messages or several groups using the label parameter.SyntaxFollowing is the syntax for the console.group() method −console.group([label])Here, label is an optional parameter. It is of type string and acts as a label for the message group created.ExampleLet us look at an example for the HTML DOM console.group() method − console.group() Method Press F12 key to view the message in the console view. NORMAL GROUP ... Read More

HTML DOM console.error() Method

AmitDiwan
Updated on 08-Aug-2019 11:59:46

54 Views

The HTML DOM console.error() method is used for writing an error message to the console. This method is very useful for testing and debugging purposes.SyntaxFollowing is the syntax for console.error() method −console.error(console.error(message))Here, message is a JavaScript string or an object. It is a required parameter value.ExampleLet us see an example for the HTML DOM console.error() method − console.error() Method Click the below button to write object as error message on the console ERROR    function errMessage(){       var errObj = { Message:"ERROR has been caused", Value:"NEGATIVE"};       console.error(errObj);    } Press F12 ... Read More

HTML DOM console.count() Method

AmitDiwan
Updated on 08-Aug-2019 11:41:38

364 Views

The HTML DOM console.count() method is used to write to console the number of times the console.count() method has been called. You can also supply an optional parameter label to this method. The label can help us in having separate counts of the console.count() method.SyntaxFollowing is the syntax for the console.count() method −console.count( [label] );Here, label is an optional parameter of type string that outputs how many times it has been called with that specified label.ExampleLet us see an example of the console.count() method − console.count() method Press F12 to view the message in the console view. COUNT ... Read More

Advertisements