Skip to content

Commit dea85fb

Browse files
committed
nine complete
1 parent 779512f commit dea85fb

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

09 - Dev Tools Domination/index-START.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,76 @@
1818
}
1919

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

2223
// Interpolated
24+
console.log('this is a %s string!', 'word');
25+
//better version of that ^ is this:
26+
const word = 'word';
27+
console.log(`this is a ${word} string!`);
2328

2429
// Styled
30+
console.log('%c I am some great text', 'font-size: 50px');
31+
//changes the font size in the console
2532

2633
// warning!
34+
console.warn('sample warning');
35+
//will give you stack trace as to where the error was called
2736

2837
// Error :|
38+
console.error('sample error');
39+
//will display error and give you stack trace
2940

3041
// Info
42+
console.info('info statement');
3143

3244
// Testing
45+
console.assert(1 === 1, 'That is wrong');
46+
//will tell you assertion failed; will only show up if it is false
47+
console.assert(4 === 1, 'That is wrong');
48+
//this will print
49+
50+
const p = document.querySelector('p');
51+
console.assert(p.classList.contains('ouch'), 'That is incorrect');
3352

3453
// clearing
54+
// console.clear();
55+
3556

3657
// Viewing DOM Elements
58+
console.dir(p);
59+
//gives you the dropdown of the properties and methods of the element
3760

3861
// Grouping together
62+
dogs.forEach(dog =>{
63+
console.groupCollapsed(`${dog.name}`);
64+
// console.group(`${dog.name}`);
65+
console.log(`This is ${dog.name}`);
66+
console.log(`${dog.age} years old`);
67+
console.groupEnd(`${dog.name}`);
68+
69+
})
70+
3971

4072
// counting
73+
console.count('Mention of things');
74+
console.count('Mention of places');
75+
console.count('Mention of places');
76+
console.count('Mention of places');
77+
console.count('Mention of people');
4178

4279
// timing
80+
console.log('fetching data');
81+
fetch('insert link here')
82+
.then(data => data.json())
83+
.then(data=>{
84+
console.timeEnd('fetching data');
85+
console.log(data);
86+
})
87+
//will tell you how long the fetch took
88+
89+
console.table(dogs);
90+
//use for array of objects that have the same properties
4391

4492
</script>
4593
</body>

0 commit comments

Comments
 (0)