Skip to content

Commit a3c5107

Browse files
committed
Day 9 - Dev tools Console tricks.
1 parent 049580a commit a3c5107

File tree

1 file changed

+41
-9
lines changed

1 file changed

+41
-9
lines changed

09 - Dev Tools Domination/index-START.html

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,60 @@
1818
}
1919

2020
// Regular
21-
21+
console.log('hello');
2222
// Interpolated
23-
23+
console.log('Hello I am a %s string.', '💩');
24+
// console.log(`Hello I am a ${variable} string `); //ES6
25+
2426
// Styled
25-
27+
console.log('%cI am some great text', 'font-size: 3rem; color: blue; background-color: white;');
28+
2629
// warning!
27-
30+
console.warn('OH NOOO');
2831
// Error :|
29-
32+
console.error('CRAP Error');
3033
// Info
31-
34+
console.info('Crocs eat 3-4 people each year');
3235
// Testing
33-
36+
const p = document.querySelector('p');
37+
console.assert(p.classList.contains('ouch'), 'No it does not contain that.');
38+
console.assert(1 === 2, 'That is wrong!');
39+
3440
// clearing
35-
41+
console.clear();
3642
// Viewing DOM Elements
37-
43+
console.log(p);
44+
console.dir(p);
45+
3846
// Grouping together
47+
dogs.forEach(dog => {
48+
console.group(`${dog.name}`); //CAN use .groupCollapsed and groups will be collapsed by default as well.
49+
console.log(`This is ${dog.name}`);
50+
console.log(`${dog.name} is ${dog.age} years old`);
51+
console.log(`${dog.name} is ${dog.age * 7} dog years old`);
52+
console.groupEnd(`${dog.name}`);
53+
});
3954

4055
// counting
56+
console.count('Jacob');
57+
console.count('Jacob');
58+
console.count('Jacob');
59+
console.count('Steve');
60+
console.count('Steve');
61+
console.count('Steve');
62+
console.count('Jacob');
4163

4264
// timing
65+
console.time('fetching data');
66+
fetch('https://api.github.com/users/wesbos')
67+
.then(data => data.json())
68+
.then(data => {
69+
console.timeEnd('fetching data');
70+
console.log(data);
71+
})
72+
73+
//table
74+
console.table(dogs);
4375

4476
</script>
4577
</body>

0 commit comments

Comments
 (0)