diff --git a/index.html b/index.html new file mode 100644 index 0000000..9b93d31 --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + +

JavaScript Concepts pt. 2

+ +

We'll learn some more JS concepts today including Objects, arrays, and forms

+ +
+ +
+ + + \ No newline at end of file diff --git a/intermediate.js b/intermediate.js new file mode 100644 index 0000000..d6ff14d --- /dev/null +++ b/intermediate.js @@ -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()); diff --git a/main.css b/main.css new file mode 100644 index 0000000..e69de29