HTML DOM Console Table Method

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

272 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 groupEnd Method

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

141 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

132 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 Error Method

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

148 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

563 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

HTML DOM Console Clear Method

AmitDiwan
Updated on 08-Aug-2019 11:36:22

767 Views

The HTML DOM console.clear() method is used to clear the console. The console.clear() method will also write “Console was cleared” message in the console and clears all the previous console content. This method is fully supported by all the browsers.SyntaxFollowing is the syntax for console.clear() method −console.clear()ExampleLet us see an example for the HTML DOM console.clear() method − JavaScript console.clear() Method Press F12 on the keyboard to see the message on your console console.log("TEXT has been printed on the console!"); Click the below button to clear the console CLEAR    function clearConsole() {       console.clear(); ... Read More

Print String After Specified Character Occurrence in C Program

Sunidhi Bansal
Updated on 08-Aug-2019 10:18:04

774 Views

Task is to print the given after the specified character occurrence for given number of times which is specified by the userInput : string = {“I am harsh vaid “}    Char =’a’    Count =2 Output : rsh vaidIt means user specified character ‘a’ and its occurrence 2 so the output string should be displayed after two occurrences of a.AlgorithmSTART Step 1 -> input character in ch(e.g. ‘a’) and count(e.g. 2) as int Step 2 -> declare and initialize n with size of a string by sizeof(string)/sizeof(string[0]) Step 3 - > Loop For i to 0 and i 0 ... Read More

Print Pattern Using One Loop in C

Sunidhi Bansal
Updated on 08-Aug-2019 09:27:32

4K+ Views

The challenge is to display the pattern using one loop only and with continue statement.AlgorithSTART Step 1 -> declare start variables i and j to 0 with number of rows in n to 6 Step 2 -> Loop For i=1 and i

Print Longest Palindrome Word in a Sentence in C Program

Sunidhi Bansal
Updated on 08-Aug-2019 09:12:57

1K+ Views

Given a sentence and the challenge is to find the longest palindrome from the given sentenceWhat is a Palindrome?Palindrome is a word or sequence whose meaning remains same even after reversing the stringExample − Nitin, after reversing the string its meaning remains the same.Challenge is to find the longest palindrome from the given sentence.Like sentence is: malayalam liemadameil ijiIt contains three palindrome words but the longest is − liemadameilAlgorithmSTART STEP 1 -> Declare start variables I, j, k, l, max to 0, index to -1, check to 0, count to 0 Step 2 -> Loop For i to 0 and ... Read More

Advertisements