diff --git a/Chapter3/Exercises b/Chapter3/Exercises deleted file mode 100644 index 1a1ec19..0000000 --- a/Chapter3/Exercises +++ /dev/null @@ -1,126 +0,0 @@ -/* -Exercise 1 -const myList = ['Milk', 'Bread', 'Apples']; -console.log(myList.length); -myList[1] = 'Bananas'; -console.log(myList); - -Exercise 2 -const myList = []; -myList.push('Milk', 'Bread', 'Apples'); -myList.splice(1, 1, 'Bananas', 'Eggs'); -const removeLast = myList.pop(); -console.log(removeLast); -myList.sort(); -console.log(myList.indexOf('Milk')); -myList.splice(1, 0, 'Carrots', 'Lettuce'); -const myList2 = ['Juice', 'Pop']; -const finalList = myList.concat(myList2, myList2); -console.log(finalList.lastIndexOf('Pop')); -console.log(finalList); - -Exercise 3 -const myArr = [1, 2, 3]; -const bigArr = [myArr, myArr, myArr]; -console.log(bigArr[0][1]); -console.log(bigArr[1][1]); -console.log(bigArr[2][1]); -console.log(bigArr); - -Exercise 4 -const myCar = { - make: 'Toyota', - model: 'Camry', - tires: 4, - doors: 4, - color: 'blue', - forSale: false -}; -let propColor = 'color'; -myCar[propColor] = 'red'; -propColor = 'forSale'; -myCar[propColor] = true; -console.log(myCar.make + ' ' + myCar.model); -console.log(myCar.forSale); - -Exercise 5 -const people = {friends:[]}; -const friend1 = {first:'Laurence',last:'Svekis',id:1}; -const friend2 = {first:'Jane',last:'Doe',id:2}; -const friend3 = {first:'John',last:'Doe',id:3}; -people.friends.push(friend1,friend2,friend3); -console.log(people); - - -const theList = ['Laurence', 'Svekis', true, 35, null, undefined, { - test: 'one', - score: 55 - }, - ['one', 'two'] -]; - -theList.length; -Array.isArray(theList); -theList[1] = "hello World"; -theList.indexOf('Laurence'); -theList.push("new one push"); -theList.pop(); -theList.shift(); -theList.unshift("make me first"); -theList.splice(1, 2); -console.log(theList); -*/ - -const myArr1 = [1,3,5,6,8,9,15]; -console.log(myArr1.indexOf(0)); -console.log(myArr1.indexOf(3)); -//What is output in the console. - - - -//How do you replace the second element in an array myArr = [1,3,5,6,8,9,15] with the value 4? -const myArr = [1,3,5,6,8,9,15] -myArr.splice(1,1,4); -console.log(myArr); - - -const myArr2 = []; -myArr2[10] = 'test' -console.log(myArr2); -console.log(myArr2[2]); -//What is output in the console. - -const myArr3 = [3,6,8,9,3,55,553,434]; -myArr3.sort(); -myArr3.length = 0; -console.log(myArr3[0]); -//What is output in the console. - - -Final Project -const inventory = []; -const item3 = { - name: 'computer', - model: 'imac', - cost: 1000, - qty: 3 -} -const item2 = { - name: 'phone', - model: 'android', - cost: 500, - qty: 11 -} -const item1 = { - name: 'tablet', - model: 'ipad', - cost: 650, - qty: 1 -} -inventory.push(item1, item2, item3); -console.log(inventory); -let total = 0; -inventory.forEach(el => { - total += el.qty; -}) -console.log(total); diff --git a/chapter10/Final Project b/chapter10/Final Project deleted file mode 100644 index 3349399..0000000 --- a/chapter10/Final Project +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Click Me Game - - - - -
- - - - diff --git a/chapter10/capture exercise b/chapter10/capture exercise deleted file mode 100644 index 064329e..0000000 --- a/chapter10/capture exercise +++ /dev/null @@ -1,44 +0,0 @@ - - - - JS Tester - - - -
-
Box #1
-
Box #2
-
Box #3
-
Box #4
-
- - - - diff --git a/chapter10/element attributes b/chapter10/element attributes deleted file mode 100644 index 80522a8..0000000 --- a/chapter10/element attributes +++ /dev/null @@ -1,35 +0,0 @@ - - - - Complete JavaScript Course - - -
-
- - - diff --git a/chapter10/ex 10 Drag and drop b/chapter10/ex 10 Drag and drop deleted file mode 100644 index e0a7006..0000000 --- a/chapter10/ex 10 Drag and drop +++ /dev/null @@ -1,55 +0,0 @@ - - - - JS Tester - - - -
1 -
- Drag Me Please! -
-
-
2
- - - diff --git a/chapter10/ex1 darkmode b/chapter10/ex1 darkmode deleted file mode 100644 index f241612..0000000 --- a/chapter10/ex1 darkmode +++ /dev/null @@ -1,13 +0,0 @@ -let darkMode = false; -window.onclick = () => { - console.log(darkMode); - if (!darkMode) { - document.body.style.backgroundColor = "black"; - document.body.style.color = "white"; - darkMode = true; - } else { - document.body.style.backgroundColor = "white"; - document.body.style.color = "black"; - darkMode = false; - } -} diff --git a/chapter10/ex11 box mover b/chapter10/ex11 box mover deleted file mode 100644 index 1d66f82..0000000 --- a/chapter10/ex11 box mover +++ /dev/null @@ -1,35 +0,0 @@ - - - - -
- - - diff --git a/chapter10/ex2 Page onload b/chapter10/ex2 Page onload deleted file mode 100644 index c70eb1a..0000000 --- a/chapter10/ex2 Page onload +++ /dev/null @@ -1,20 +0,0 @@ - - - - JS Tester - -    - - - diff --git a/chapter10/ex3 Mouse events b/chapter10/ex3 Mouse events deleted file mode 100644 index 7a71a93..0000000 --- a/chapter10/ex3 Mouse events +++ /dev/null @@ -1,32 +0,0 @@ - - - - JS Tester - -  -
  - - - diff --git a/chapter10/ex4 analytics b/chapter10/ex4 analytics deleted file mode 100644 index e4723da..0000000 --- a/chapter10/ex4 analytics +++ /dev/null @@ -1,33 +0,0 @@ - - - - JS Tester - - -  -
-
Box #1
-
Box #2
-
Box #3
-
Box #4
-
  - - - diff --git a/chapter10/ex5 UseCapture b/chapter10/ex5 UseCapture deleted file mode 100644 index 9266b13..0000000 --- a/chapter10/ex5 UseCapture +++ /dev/null @@ -1,41 +0,0 @@ - - - - JS Tester - - -  -
-
Box #1
-
Box #2
-
Box #3
-
Box #4
-
  - - - diff --git a/chapter10/ex6 Event Change b/chapter10/ex6 Event Change deleted file mode 100644 index 405c038..0000000 --- a/chapter10/ex6 Event Change +++ /dev/null @@ -1,42 +0,0 @@ - - - - JS Tester - -  -
-
- -
-
- - - diff --git a/chapter10/ex7 Image Generator b/chapter10/ex7 Image Generator deleted file mode 100644 index e7a48b3..0000000 --- a/chapter10/ex7 Image Generator +++ /dev/null @@ -1,37 +0,0 @@ - - - - JS Tester - - -
- Size: -
Add Text: -
Select Color: -
Preview:
-     -
- - - diff --git a/chapter10/ex8 Input Number checker b/chapter10/ex8 Input Number checker deleted file mode 100644 index b971725..0000000 --- a/chapter10/ex8 Input Number checker +++ /dev/null @@ -1,28 +0,0 @@ - - - - JS Tester - - -
-     -     - - - diff --git a/chapter10/ex9 Form checker b/chapter10/ex9 Form checker deleted file mode 100644 index bec0436..0000000 --- a/chapter10/ex9 Form checker +++ /dev/null @@ -1,44 +0,0 @@ - - - - JS Tester - - -
- First: -
Last: -
Age: -
-
- - - diff --git a/chapter10/keyword this button example b/chapter10/keyword this button example deleted file mode 100644 index e8e86e6..0000000 --- a/chapter10/keyword this button example +++ /dev/null @@ -1,22 +0,0 @@ - - - - JS Tester - - -
- - - -
- - - diff --git a/chapter2/2-1 b/chapter2/2-1 deleted file mode 100644 index 9d57d83..0000000 --- a/chapter2/2-1 +++ /dev/null @@ -1,5 +0,0 @@ -const myName = "Maaike"; -const myAge = 29; -const coder = true; -const message = "Hello, my name is "+myName+", I am "+myAge+" years old and I can code JavaScript: "+coder+"."; -console.log(message); diff --git a/chapter2/ex2 b/chapter2/ex2 deleted file mode 100644 index d419f76..0000000 --- a/chapter2/ex2 +++ /dev/null @@ -1,14 +0,0 @@ -let myDistanceKM = 130; -let myDistanceMiles = myDistanceKM * 1.60934; -console.log('The distance of ' + myDistanceKM + ' kms is equal to ' + myDistanceMiles + ' miles') - -//1 inch = 2.54 centimeters. -//2.2046 pounds in a kilo -let inches = 72; -let pounds = 180; -let weight = pounds / 2.2046; // in kilos -let height = inches * 2.54; // height in centemeters -console.log(inches,pounds); -console.log(weight, height); -let bmi = weight/(height/100*height/100); -console.log(bmi); diff --git a/chapter4/exercises b/chapter4/exercises deleted file mode 100644 index be25e28..0000000 --- a/chapter4/exercises +++ /dev/null @@ -1,274 +0,0 @@ -//Exercise 1 -/* -const test = false; -console.log((test)); -if(test){ - console.log("Its True"); -} -if(!test){ - console.log("False now"); -} - -//Exercise 2 -let age = 10; -let cost = 0; -let message; -if (age < 3) { - cost = 0; - message = "Access is free under three."; -} else if (age >= 3 && age < 12) { - cost = 5; - message ="With the child discount, the fee is 5 dollars"; -} else if (age >= 12 && age < 65) { - cost = 10; - message ="A regular ticket costs 10 dollars."; -} else { - cost = 7; - message ="A ticket is 7 dollars."; -} - -console.log(message); -console.log("Your Total cost "+cost); - - - -let age = prompt("How old are you?"); -age = Number(age); -let message; -if(age >= 21){ - message = "You can enter and drink."; -}else if(age >= 19){ - message = "You can enter but not drink."; -}else{ - message = "You are not allowed in!"; -} -console.log(message); - - -//Exercise 3 -const id = true; -const message = (id) ? "Allowed In" : "Denied Entry"; -console.log(message); - - - -//Exercise 4 -let prize = prompt("Pick a number 0-10"); -prize = Number(prize); -let output = "My Selection: "; -switch (prize){ - case 0: - output += "Gold "; - case 1: - output += "Coin "; - break; - case 2: - output += "Big "; - case 3: - output += "Box of "; - case 4: - output += "Silver "; - case 5: - output += "Bricks "; - break; - default: - output += "Sorry Try Again"; -} -console.log(output); - - -//Project 1 -let answer = "Something went wrong"; -let question = prompt("Ask me anything"); -const randomNumber = Math.floor(Math.random() * 6); -switch (randomNumber) { - case 0: - answer = "It will work out"; - break; - case 1: - answer = "Maybe maybe not"; - break; - case 2: - answer = "Probably not"; - break; - case 3: - answer = "Highly likely"; - break; - default: - answer = "I don"t know about that"; -} -let output = "You asked me " + question + ". I think that " + answer; -console.log(output); - - -const myArr = ["Rock", "Paper", "Scissors"]; -let computer = Math.floor(Math.random() * 3); -let player = Math.floor(Math.random() * 3); -let message = "player " + myArr[player] + " vs computer " + myArr[computer] + " "; - -if (player === computer) { - message += "its a tie"; -} else if (player > computer) { - if (computer == 0 && player == 2) { - message += "Computer Wins"; - } else { - message += "Player Wins"; - } -} else { - if (computer == 2 && player == 0) { - message += "Player Wins"; - } else { - message += "Computer Wins"; - } -} -console.log(message); - - - -//Question 1 - -const q = 1; - -switch (q) { - case "1": - answer = "one"; - case 1: - answer = 1; - case 2: - answer = "this is the one"; - break; - default: - answer = "not working"; -} -console.log(answer); - - -let myTime = 9; -let output; -if (myTime >= 8 && myTime < 12) { - output = "Wake up its morning"; -} else if (myTime >= 12 && myTime < 13) { - output = "go to Lunch"; -} else if (myTime >= 13 && myTime <= 16) { - output = "Go to work"; -} else if (myTime > 16 && myTime < 20) { - output = "Dinner Time"; -} else if (myTime >= 22) { - output = "Time to go to sleep"; -} else { - output = "You should be sleeping"; -} -console.log(output); - - - -let today = prompt("pick a number"); -today = Number(today); -let output; -switch (today) { -case 0: - output = "Sunday"; - break; -case 1: - output = "Monday"; - break; -case 2: - output = "Tuesday"; - break; -case 3: - output = "Wednesday"; - break; -case 4: - output = "Thursday"; - break; -case 5: - output = "Friday"; - break; -case 6: - output = "Saturday"; - break; -default: - output = "Not found"; -} -console.log("Today is "+output); - - - -let val = 100; -let message = (val > 100) ? "${val} was greater than 100" : "${val} was LESS or Equal to 100"; -console.log(message); -let check = (val % 2) ? "Odd" : "Even"; -check = "${val} is ${check}"; -console.log(check); - -let a = 5; - -let b = 10; - -let c = 20; - -let d = 30; - -console.log(a > b || b > a); - -console.log(a > b && b > a); - -console.log(d > b || b > a); - -console.log(d > b && b > a); - - - -let age = prompt("How old are you?"); -age = Number(age); -if (!age) { - age = prompt("Enter a Number?"); -} -let message; -if (age >= 21) { - message = "You are " + age + " and allowed to come in and drink."; -} else if (age >= 18) { - message = "You are " + age + " and allowed to come in but NOT drink."; -} else { - message = "You are NOT allowed in. Sorry you are only " + age + " "; -} -console.log(message); - -let val = prompt("what number?"); -val = Number(val); -let num = 100; -let message = "nothing"; -if (val > num) { - message = val + " was greater than " + num; -} else if (val == num) { - message = val + " was equal to " + num; -} else { - message = val + " is less than " + num; -} -console.log(message); - -let person = prompt("Enter a name?"); -let message; -switch (person) { - case "John" : - case "Larry" : - case "Jane" : - case "Laurence" : - message = person +" is my friend"; - break; - default : - message = "I don\"t know "+person; -} -console.log(message); - -*/ - -const userNames = ["Mike", "John", "Larry"]; -const userInput = "John"; -let htmlOutput = ""; -if (userNames.indexOf(userInput) > -1) { - htmlOutput = "Welcome, that is a user"; -} else { - htmlOutput = "Denied, was not a usernot true "; -} -console.log(htmlOutput + ":, " + userInput); diff --git a/chapter5/Random String Generator b/chapter5/Random String Generator deleted file mode 100644 index ebfade3..0000000 --- a/chapter5/Random String Generator +++ /dev/null @@ -1,15 +0,0 @@ - -Random String Generator - - - - diff --git a/chapter5/exercises b/chapter5/exercises deleted file mode 100644 index e7f8ffc..0000000 --- a/chapter5/exercises +++ /dev/null @@ -1,190 +0,0 @@ -/* -const hiddenNumbers = []; -const total = 3; -const max = 5; -for(let x=0;x ranNumber) { - console.log('Too high'); - } else { - console.log('Too Low'); - } -} - - - -//Exercise #3 - -let tempNum = ''; -let total = prompt('How many digits in the number?'); -let max = 5; -total = Number(total); -for (let x = 0; x < total; x++) { - const ranNumber = Math.floor(Math.random() * (max + 1)) ; - tempNum += ranNumber; -} -console.log(tempNum); - - - -//Exercise #2 -let step = 105; -let counter = 0; -do { - console.log(counter); - counter += step; -} -while (counter <= 100); - - - - -//Exercise 4 - -const myTable = []; -const rows = 4; -const cols = 7; -let counter = 0; -for (let y = 0; y < rows; y++) { - let tempTable = []; - for (let x = 0; x < cols; x++) { - counter++; - tempTable.push(counter); - } - myTable.push(tempTable); -} -console.table(myTable); - - -//Exercise 5 - -const grid = []; -const cells = 64; -let counter = 0; -let row; -for (let x = 0; x < cells + 1; x++) { - if (counter % 8 == 0) { - if (row != undefined) { - //console.log(row); - grid.push(row); - } - row = []; - } - counter++; - let temp = counter; - //console.log(temp); - row.push(temp); -} - -console.table(grid); - - -const myArray = []; -for (let x = 0; x < 10; x++) { - myArray.push(x + 1); -} -console.log(myArray); - -for (let val of myArray) { - console.log(val); -} -for (let i = 0; i < myArray.length; i++) { - console.log(myArray[i]); -} - - -const myWork = []; -for (let x = 1; x < 10; x++) { - let stat = x % 2 ? true : false; - let temp = { - name: `Lesson ${x}` - , status: stat - }; - myWork.push(temp); -} -console.log(myWork); - -const obj = { - a: 1, - b: 2, - c: 3 -}; -console.log(obj); -for (let prop in obj) { - console.log(prop, obj[prop]); -} -const arr = ['a', 'b', 'c']; -for (let w = 0; w < arr.length; w++) { - console.log(w, arr[w]); -} - -for (el in arr) { - console.log(el, arr[el]); -} - -arr.forEach(function (el, index, array) { - console.log(array); - console.log(index, el); -}) - - - - -let output = ''; -let skipThis = 7; -for (let i = 0; i < 10; i++) { - if (i === skipThis) { - break; - } - output += i; -} - -console.log(output); - - - - -const myTable = []; -const numm = 10; -for(let x=0;x< numm;x++){ - const temp = []; - for(let y = 0;y 10) { - break; - } - console.log(i); -} -*/ - - -const myArray = [1,5,7]; -for(el in myArray){ - console.log(Number(el)); - el = Number(el) + 5; - console.log(el); -} -console.log(myArray); diff --git a/chapter9/ex2 b/chapter9/ex2 deleted file mode 100644 index bc8defc..0000000 --- a/chapter9/ex2 +++ /dev/null @@ -1,7 +0,0 @@ - -
Hello World
- - diff --git a/chapter9/ex3 b/chapter9/ex3 deleted file mode 100644 index e72f1ca..0000000 --- a/chapter9/ex3 +++ /dev/null @@ -1,7 +0,0 @@ -
Hello World 1
-
Hello World 2
-
Hello World 3
- diff --git a/chapter9/ex4 b/chapter9/ex4 deleted file mode 100644 index 5aef9c3..0000000 --- a/chapter9/ex4 +++ /dev/null @@ -1,9 +0,0 @@ - -
Hello World 1
-
Hello World 2
-
Hello World 3
- - diff --git a/chapter9/mouseEvents b/chapter9/mouseEvents deleted file mode 100644 index b996988..0000000 --- a/chapter9/mouseEvents +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Complete JavaScript Course - - - -  -  
    -    
    -
    - - - - diff --git a/chapter9/shoppingList b/chapter9/shoppingList deleted file mode 100644 index 29d6f8e..0000000 --- a/chapter9/shoppingList +++ /dev/null @@ -1,25 +0,0 @@ - - -    Complete JavaScript Course    - -    -    
  -         - -
       -  

Shopping List

  -
  -   - - - diff --git a/chapter9/star project b/chapter9/star project deleted file mode 100644 index 267ec3b..0000000 --- a/chapter9/star project +++ /dev/null @@ -1,55 +0,0 @@ - - - - Star Rater - - - - - -
- - - diff --git a/chapter9/voter b/chapter9/voter deleted file mode 100644 index 2398500..0000000 --- a/chapter9/voter +++ /dev/null @@ -1,61 +0,0 @@ - - - -    Complete JavaScript Course    - - -    -
Complete JavaScript Course
    -
      - - -
    -
    - - - -