1+ // To Display The Output We Use Console.log
2+ console . log ( "Hello World" ) ;
3+ console . log ( 'Hello World' ) ;
4+ // ----------------------------------------------------
5+ // //Double Quotations and Single Quotations are Same both can be Used
6+ // ----------------------------------------------------
7+ // //Comments in JavaScript
8+
9+ // // Single Line Comment Starts with //
10+
11+ // // This is a Single Line Comment
12+
13+ /*
14+ This is a Multi Line Comment
15+ This is a Multi Line Comment
16+ This is a Multi Line Comment
17+ This is a Multi Line Comment
18+ */
19+ // -
20+
21+
22+ // To Run This File
23+ // node fileName.js
24+ // node 1.js
25+
26+
27+
28+
29+ // / Differnet Uses of Console logs
30+
31+ // let x = 1;
32+ // console.log(x); // 1
33+
34+ // let y = 2,z=3,q=5;
35+ // console.log(y,z,q);//2 3 5
36+
37+ // How to Convert an Output in an Object just to show it
38+ // It will not change its data type
39+ // Just Add {} in Console
40+ // let x = 1
41+ // let y = 2
42+ // let z = 3
43+ // console.log( {x, y, z} )
44+
45+ // %s is for string
46+ // %d is for number
47+ // console.log("%s is %d years old.", "John", 29)
48+
49+ // Variations of logs
50+ // There are a few variations of logs. There is the most widely used console.log(). But there is also:
51+
52+ // console.log("Console Log");
53+ // console.info("Console Info");
54+ // console.debug("Console Debug");
55+ // console.warn("Console Warn");
56+ // console.error("Console Error");
57+ // console.count();
58+
59+ // for(i=0; i<10; i++){
60+ // console.count();
61+ //
62+ // }
63+
64+ // console.time();
65+ // setTimeout(() => {
66+ // console.log("This Message Printed After 5 Seconds");
67+ // console.timeEnd();
68+ // }, 5000);
69+
70+ // Output:
71+ // This Message Printed After 5 Seconds
72+ // default: 5.007s
73+
74+ // console.time()
75+
76+ // setTimeout(() => {
77+ // console.timeEnd()
78+ // }, 5000)
79+
80+ // setTimeout(() => {
81+ // console.timeLog()
82+ // }, 2000)
83+
84+ // ----------------------------------------
85+ // console.log('I am not in a group')
86+
87+ // console.group()
88+ // console.log('I am in a group')
89+ // console.log('I am also in a group')
90+ // console.groupEnd()
91+
92+ // console.log('I am not in a group')
93+
94+ // Output:
95+ // I am not in a group
96+ // I am in a group
97+ // I am also in a group
98+ // I am not in a
99+
100+ // -----------------------------------
101+
102+
103+ // let devices = [
104+ // {
105+ // name: 'iPhone',
106+ // brand: 'Apple'
107+ // },
108+ // {
109+ // name: 'Galaxy',
110+ // brand: 'Samsung'
111+ // }
112+ // ]
113+
114+ // console.table(devices)
115+
116+ // ┌─────────┬──────────┬───────────┐
117+ // │ (index) │ name │ brand │
118+ // ├─────────┼──────────┼───────────┤
119+ // │ 0 │ 'iPhone' │ 'Apple' │
120+ // │ 1 │ 'Galaxy' │ 'Samsung' │
121+ // └─────────┴──────────┴───────────┘
122+
123+ // %c is for Styling // Visble in Browser Console
124+ // console.log("%c This is yellow text on a blue background.", "color:yellow; background-color:blue")
125+
126+
127+
128+ // --------------------------------------------------------
129+ // Just add console.clear() to the top of your code and you'll have a fresh console every time you refresh. ?
130+ // Just don't add it to the bottom of your code, lol.
131+ // console.clear()
132+
133+ // console.assert
134+ // This method is used to check if a condition is true. If it's not, it will throw an error.
135+
136+ // console.assert(/** Condition **/, /** Error message **/);
137+
138+
139+ // console.assert(1 === 1, "1 is equal to 1"); // No error
140+ // console.assert(0 === [], "0 is equal to []"); // Error in the console
141+
142+
143+ const { log :say } = console ;
144+
145+ say ( "Hey Suhail" ) ;
146+
147+ var bol = console . log
148+ bol ( "hello" )
0 commit comments