Skip to content

Commit 5fdd6f2

Browse files
authored
Update index-FINISHED.html
1 parent 78ce90a commit 5fdd6f2

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

09 - Dev Tools Domination/index-FINISHED.html

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
<script>
1212
const dogs = [{ name: 'Snickers', age: 2 }, { name: 'hugo', age: 8 }];
1313

14+
/*
15+
* Dev Tool Tip
16+
* If you see something happening but can't find the code here is a trick with Attribute Modifications
17+
* With devtools inspect the element > break on... > attribute modifications
18+
* This adds a breakpoint and will pause where the line of code is causing the attribute
19+
*/
1420
function makeGreen() {
1521
const p = document.querySelector('p');
1622
p.style.color = '#BADA55';
@@ -20,17 +26,21 @@
2026
// Regular
2127
console.log('hello');
2228

23-
// Interpolated
29+
// Interpolated (%s = simple function to replace something in a string)
2430
console.log('Hello I am a %s string!', '💩');
2531

26-
// Styled
32+
// Backticks do the same thing as the interpolation example above
33+
const poo = '💩';
34+
console.log(`Hello I am a ${poo} string!`);
35+
36+
// Styled (%c = lets you style things in the console)
2737
// console.log('%c I am some great text', 'font-size:50px; background:red; text-shadow: 10px 10px 0 blue')
2838

2939
// warning!
3040
console.warn('OH NOOO');
3141

3242
// Error :|
33-
console.error('Shit!');
43+
console.error('Shitballs!');
3444

3545
// Info
3646
console.info('Crocodiles eat 3-4 people per year');
@@ -44,34 +54,34 @@
4454
console.clear();
4555

4656
// Viewing DOM Elements
47-
console.log(p);
48-
console.dir(p);
57+
console.log(p); // shows a matching paragraph in the DOM
58+
console.dir(p); // dir shows all properties and methods of an object
4959

50-
console.clear();
60+
console.clear(); // clears out the console
5161

5262
// Grouping together
5363
dogs.forEach(dog => {
54-
console.groupCollapsed(`${dog.name}`);
64+
// console.group(`${dog.name}`); // expands all of the log
65+
// console.groupCollapsed(`${dog.name}`); // puts logged items in a dropdown
5566
console.log(`This is ${dog.name}`);
5667
console.log(`${dog.name} is ${dog.age} years old`);
5768
console.log(`${dog.name} is ${dog.age * 7} dog years old`);
5869
console.groupEnd(`${dog.name}`);
5970
});
6071

6172
// counting
62-
63-
console.count('Wes');
64-
console.count('Wes');
65-
console.count('Steve');
66-
console.count('Steve');
67-
console.count('Wes');
68-
console.count('Steve');
69-
console.count('Wes');
70-
console.count('Steve');
71-
console.count('Steve');
72-
console.count('Steve');
73-
console.count('Steve');
74-
console.count('Steve');
73+
console.count('Ponybuckets');
74+
console.count('Bernard');
75+
console.count('Madoff');
76+
console.count('Madoff');
77+
console.count('Bernard');
78+
console.count('Madoff');
79+
console.count('Bernard');
80+
console.count('Madoff');
81+
console.count('Madoff');
82+
console.count('Madoff');
83+
console.count('Madoff');
84+
console.count('Madoff');
7585

7686
// timing
7787
console.time('fetching data');
@@ -82,6 +92,7 @@
8292
console.log(data);
8393
});
8494

95+
// table - for displaying an array in a table
8596
console.table(dogs);
8697

8798
</script>

0 commit comments

Comments
 (0)