-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavascriptBasics.html
More file actions
47 lines (45 loc) · 4.88 KB
/
JavascriptBasics.html
File metadata and controls
47 lines (45 loc) · 4.88 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Javascript Basics</title>
<link rel="stylesheet" type="text/css" href="JavascriptBasics.css">
</head>
<body>
<div id="wrapper">
<p id="header">JavaScript Basics</p>
<div id="navigation">
<a class="link" href="#">Home</a>
<ul id="navlist">
<li>
<a class="link" href="#">Javascript Overview</a>
<ul id="subnavlist">
<li><a class="link" href="#">Variable Declaration</a></li>
<li><a class="link" href="#">Variable Assignment</a></li>
<li><a class="link" href="#">Data Type</a></li>
<li><a class="link" href="#">Conditionals</a></li>
<li><a class="link" href="#">Loops</a></li>
<li><a class="link" href="#">Functions</a></li>
</ul>
</li>
<li><a class="link" href="#">Projects</a></li>
<li><a class="link" href="#">Assignments</a></li>
<li><a class="link" href="#">Quiz</a></li>
</ul>
</div>
<div id="content">
<p id="title2">JavaScript Basics</p>
<p>JavaScript is a cross-platform, object-oriented scripting language. JavaScript is extremely popular for a variety of reasons. It is a small and lightweight language allowing maximum flexibility for developers to take it in a bunch of different directions. JavaScript lives inside a host environment (a web browser or Node server), it can be connected to the objects of these environments to provide programmatic control over them.</p>
<ul id="conlist">
<li><p><a class="link" href="#">Variable Declaration</a> JavaScript variables are containers for storing data values - imagine a cup you fill with coffee, the cup holds the coffee, a variable holds a value. All JavaScript variables must be identified with unique names. These unique names are called identifiers. <mark class="example">var x;</mark></p></li>
<li><p><a class="link" href="#">Variable Assignment</a> Assignment operators assign values to JavaScript variables - our cup can now have coffee poured in it, giving our variable a value to hold. The = assignment operator assigns a value to a variable. <mark class="example">var x = 10;</mark></p></li>
<li><p><a class="link" href="#">Data Types</a> Data types are an important concept; to be able to operate on variables you need to know the data type. There are six data types that are JavaScript primitives: Boolean - <mark class="example">true</mark> or <mark class="example">false;</mark> null - <mark class="example">null</mark> aka nothing; Number - <mark class="example">42</mark> or <mark class="example">3.14159;</mark> String - <mark class="example">"Coding Dojo Rocks!";</mark> Array - <mark class="example">[1, 'Coding', 2, 'Dojo'];</mark> and Object - <mark class="example">{first_name: 'Jane',last_name: 'Doe'}</mark></p></li>
<li><p><a class="link" href="#">Conditionals</a> When you write code, you want to perform different actions for different decisions - hitting different code blocks based on values or conditions that have been met. You can use conditional statements in your code to accomplish this. There are the following conditional statements: <mark class="example">if</mark> a specified condition is true, do this code in our code block; <mark class="example">else if</mark> to specify a new condition to test, if the first condition is false; <mark class="example">else</mark> we execute this block of code;</p></li>
<li><p><a class="link" href="#">Loops</a> There are many different kinds of loops in every programming language, but they all essentially do the same thing: they will repeat an action some number of times. Imagine you have to run a mile, well you trun around the track four times and then you stop. That's a loop!</p></li>
<li><p><a class="link" href="#">Function</a> Functions are an encapsulation of a code block. WHen we call our function this will run that code block. Think of it as a list of instructions. As an example imagine we are putting together a desk from Ikea, we open up the instruction manual and get started, first we screw the legs to the table top; next we place the table the right way up. Done! We finished out instructions. Sadly there are a ton more tables to do so lets call our function over and over and over again.</p></li>
</ul>
</div>
<p id="footer">For more useful information check out this url: <a class="link" href="#">JavaScript!</a></p>
</div>
</body>
</html>