Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Initial class updates
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="./main.css"> | ||
</head> | ||
<body> | ||
<h1>JavaScript Concepts pt. 2</h1> | ||
|
||
<p>We'll learn some more JS concepts today including Objects, arrays, and forms</p> | ||
|
||
<form> | ||
|
||
</form> | ||
<script src="intermediate.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
function checkForm() { | ||
var formCount = document.forms.length; | ||
|
||
if(formCount > 0) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} | ||
|
||
// AND/OR | ||
var bool1 = true; | ||
var bool2 = false; | ||
|
||
if(bool1 && bool2) { | ||
console.log("AND"); | ||
} else if(bool1 || bool2 && 1 > 3) { | ||
console.log("OR"); | ||
} | ||
|
||
// Ternary operators | ||
|
||
var result = (bool1) ? "The expression is true" : "The expression is false"; | ||
console.log(result); | ||
|
||
var personInfo = { | ||
firstName: "Joe", | ||
lastName: "Smith", | ||
state: "CT", | ||
zipCode: "06111", | ||
fullName: function() { | ||
return this.firstName + " " + this.lastName; | ||
} | ||
}; | ||
|
||
console.log(personInfo.firstName); | ||
console.log(personInfo.fullName()); |