Visitar URL original
learned and finished day09 · soyaine/JavaScript30@8eb455b · GitHub
Skip to content

Commit 8eb455b

Browse files
committed
learned and finished day09
1 parent e37bf5e commit 8eb455b

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

‎09 - Dev Tools Domination/index-START.html‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,70 @@
1818
}
1919

2020
// Regular
21+
console.log('hello world');
2122

2223
// Interpolated
24+
console.log('I am string %s', 'log');
25+
console.log('I am int %d', '1.23');
26+
console.log('I am object %o' ,{apple: '1kg'});
2327

2428
// Styled
29+
console.log('%c This text have the styled that set behind',"color: #00fdff; font-size: 2em;");
2530

2631
// warning!
32+
console.warn('This is warnning log');
2733

2834
// Error :|
35+
console.error('This is error log');
2936

3037
// Info
38+
console.info('This is info log');
3139

3240
// Testing
41+
console.assert(1===1,'only show this message when return false');
42+
console.assert(1===0,'only show this message when return false 2');
43+
44+
const p = document.querySelector('p');
45+
console.assert(p.innerHTML.match('T'),'can not find this alphabet');
3346

3447
// clearing
48+
// console.clear();
3549

3650
// Viewing DOM Elements
51+
console.log(p); // html tag
52+
console.dir(p); // list of attributes
3753

3854
// Grouping together
55+
dogs.forEach(dog => {
56+
console.group();
57+
// console.groupCollapsed();
58+
console.log(`${dog.name}`);
59+
console.log(`${dog.age}`);
60+
console.log(`${dog.name} is ${dog.age} years old`);
61+
console.groupEnd();
62+
});
63+
64+
console.table(dogs);
65+
console.table(dogs, ["age"]);
3966

4067
// counting
68+
console.count("sheep");
69+
console.count("sheep");
70+
console.count("fish");
71+
console.count("sheep");
72+
console.count("sheep");
73+
console.count("fish");
74+
console.count("fish");
75+
console.count("sheep");
4176

4277
// timing
43-
78+
console.time('fetch my data');
79+
fetch("https://api.github.com/users/lchungy90")
80+
.then(data => data.json())
81+
.then(data => {
82+
console.timeEnd('fetch my data');
83+
console.log(data);
84+
});
4485
</script>
4586
</body>
4687
</html>

0 commit comments

Comments
 (0)