Skip to content

Commit 116fc6a

Browse files
committed
Finished wesbos#9
1 parent 99ca957 commit 116fc6a

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

09 - Dev Tools Domination/index-START.html

Lines changed: 30 additions & 1 deletion
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 }];
1313

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

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

2223
// Interpolated
24+
console.log('Hello I\'m a %s string!', '🍕' );
2325

2426
// Styled
27+
console.log('%cI\'m some white text.', 'padding: 10px 15px; margin: 0 0 3px; font-size: 16px; font-family: "Consolas", monospace; line-height: 1.0; background-color: pink; color: white;')
2528

2629
// warning!
30+
console.warn('OH NOOOOO!!!!');
2731

2832
// Error :|
33+
console.error('Shit!');
2934

3035
// Info
36+
console.info('Crocodiles sometimes eat people! 🐊');
3137

3238
// Testing
39+
const p = document.querySelector('p');
40+
console.assert(p.classList.contains('ouch'), 'You didn\'t select the right element!');
3341

3442
// clearing
43+
// console.clear();
3544

3645
// Viewing DOM Elements
46+
// console.log(p);
47+
console.dir(p);
3748

3849
// Grouping together
50+
dogs.forEach(dog => {
51+
console.groupCollapsed(`${dog.name}`);
52+
console.log(`This is ${dog.name}`);
53+
console.log(`${dog.name} is ${dog.age} years old`);
54+
console.log(`${dog.name} is ${dog.age * 7} dog years old`);
55+
console.groupEnd();
56+
})
3957

4058
// counting
59+
console.count('Dogs!');
4160

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

4473
</script>
4574
</body>

0 commit comments

Comments
 (0)