-
Notifications
You must be signed in to change notification settings - Fork 1
/
errors.html
34 lines (31 loc) · 1.79 KB
/
errors.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<title>JS Tutorial - Educational Websites</title>
<script>
console.log("This is a log");
console.warn("This is a warn");
console.error("This is an error");
</script>
</head>
<body>
<section>
<h1 id="intro">J<span>ava</span>S<span>crip</span>t Tu<span>tori</span>al</h1><br><br><br>
<!-- Lesson 2 -->
<h2 id="lesson-text">Lesson 8 - Errors</h2><br><br><br>
<h3 id="lesson-text2">You must be knowing about bugs. No, i'm talking about the coding bugs. They are typos in code which can mess up the output. Even replacing an "e" with a "b" can change or even crash the output. So how to you keep a track of errors, and catch them when they happen?<br><br>
The Console. If you do a CTRL + Shift + J combo on your keyboard, you will see the console. Its just a place to display error and log info. So, how to we do that?<br><br>
We have 3 commands: console.log(), console.warn(), console.error(). Logs are displayed white, warns are yellow, and errors are red. You can log the console to check if stuff is working. EG: you can check if a program is running by doing a if loop, and logging the console "program on". or, you can error the console if the program is not working.<br><br>
The console is a helpful tool for Javascript.<br><br><br>
Open the console now to see examples of logs, errors and warns!
<br>
<br>
<br>
<a href="./document.html" class="green-btn">< Previous</a><span style="color:transparent;">-------------------------</span>
<a href="./conditional_loops.html" class="green-btn">Next ></a>
</h3>
</section>
</body>
</html>