Skip to content

Commit b9f3d29

Browse files
committed
1212
1 parent c392bb0 commit b9f3d29

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed
1.78 MB
Loading

09 - Dev Tools Domination/index-START.html

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<p onClick="makeGreen()">×BREAK×DOWN×</p>
1010

1111
<script>
12-
const dogs = [{ name: 'Snickers', age: 2 }, { name: 'hugo', age: 8 }];
12+
const dogs = [{ name: 'Snickers', age: 2 }, { name: 'hugo', age: 8 }, { name: 'bb', age: 1 }];
1313

1414
function makeGreen() {
1515
const p = document.querySelector('p');
@@ -18,28 +18,58 @@
1818
}
1919

2020
// Regular
21-
21+
console.log('hello');
2222
// Interpolated
23-
23+
console.log('hello %s', 'shit');
2424
// Styled
25-
25+
console.log('%c I am ', 'font-size:50px');
2626
// warning!
27+
console.warn('oh nooo');
2728

2829
// Error :|
30+
console.error('oh nooo');
2931

3032
// Info
31-
33+
console.info('oh nooo');
3234
// Testing
35+
const p = document.querySelector('p');
36+
console.assert(1===2, 'oh nooo 1 isnt 2');
37+
console.assert(p.classList.contains('ouch'), 'oh nooo 1 isnt 2');
3338

3439
// clearing
35-
40+
console.clear();
3641
// Viewing DOM Elements
42+
console.log(p);
43+
console.dir(p);
3744

45+
console.clear();
3846
// Grouping together
39-
47+
dogs.forEach(dog => {
48+
console.group(`${dog.name}`);
49+
console.log(`This is ${dog.name}`);
50+
console.log(`This is ${dog.age}`);
51+
console.log(`This is ${dog.age*100}`);
52+
console.groupEnd(`${dog.name}`);
53+
})
4054
// counting
55+
console.count('a');
56+
console.count('a');
57+
console.count('b');
58+
console.count('a');
59+
console.count('a');
60+
console.count('b');
4161

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

4474
</script>
4575
</body>

0 commit comments

Comments
 (0)