diff --git a/README.md b/README.md index 424f85685..cd98cf504 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,28 @@ >Please help us improve and share your feedback! If you find better tutorials or links, please share them by opening a Pull Request. -# HackYourJavaScript +# Social Hacking Javascript - + Here you can find course content and homework for the JavaScript 1,2 and 3 modules |Week|Topic|Read|Homework|Review| |----|-----|----|--------|------| -|0.|Preparation for your first JavaScript session|[Pre-reading](https://github.com/HackYourFuture/JavaScript/tree/master/Week0) + [CLI Reading Week 1](https://github.com/HackYourFuture/CommandLine/blob/master/Lecture-1.md)|-| -|1.|• [CLI](https://github.com/HackYourFuture/CommandLine) session with Unmesh :heart:
• Intro JavaScript (What is it, where can you use it for)
• Variables [var, let, const]
• Basic Data types [Strings, Numbers, Arrays]
• Operators|[Reading Week 1](https://github.com/HackYourFuture/JavaScript/tree/master/Week1/README.md) | [Homework Week 1](https://github.com/HackYourFuture/JavaScript/tree/master/Week1/MAKEME.md)|[Review](https://github.com/HackYourFuture/JavaScript/blob/master/Week1/REVIEW.md)| -|2.|• Advanced data types [Objects]
• Conditions
• Statements vs Expressions
• Loops (for/while)
• Functions
• Naming conventions|[Reading Week 2](https://github.com/HackYourFuture/JavaScript/tree/master/Week2/README.md)|[Homework Week 2](https://github.com/HackYourFuture/JavaScript/tree/master/Week2/MAKEME.md)|[Review](https://github.com/HackYourFuture/JavaScript/blob/master/Week2/REVIEW.md)| -|3.|• [CLI](https://github.com/HackYourFuture/CommandLine) session with Unmesh :balloon:
• Closures
• Scope
• Array Manipulations
• Basic DOM manipulations [img src, innerHTML]
• Code commenting|[Reading Week 3](https://github.com/HackYourFuture/JavaScript/tree/master/Week3)|[Homework Week 3](https://github.com/HackYourFuture/JavaScript/tree/master/Week3/MAKEME.md)|[Review](https://github.com/HackYourFuture/JavaScript/blob/master/Week3/REVIEW.md)| -|4.|• JSON
• Code debugging using the browser
• Functions + JSON/Arrays
• Code flow (order of execution)
• (capturing user input)
• Structuring code files|[Reading Week 4](https://github.com/HackYourFuture/JavaScript/tree/master/Week4)|[JS](https://github.com/HackYourFuture/JavaScript/tree/master/Week4/MAKEME.md) + [Git Homework Week 4](https://github.com/HackYourFuture/Git/blob/master/Lecture-1.md)|Review| -|5.|• First Git Session with Unmesh :smiling_imp:
• Events
• Callbacks
• XHTTP Requests
• API calls|[Reading Week 5](https://github.com/HackYourFuture/JavaScript/tree/master/Week5)|[Homework Week 5](https://github.com/HackYourFuture/JavaScript/tree/master/Week5/MAKEME.md)|[Review](https://github.com/HackYourFuture/JavaScript/blob/master/Week5/REVIEW.MD)| -|6.|• Second Git Session :see_no_evil:
• Async VS Sync
• Polling
• Structure for a basic SPA
TEST :boom:|[Reading Week 6](https://github.com/HackYourFuture/JavaScript/tree/master/Week6)|[Homework Week 6](https://github.com/HackYourFuture/JavaScript/tree/master/Week6/MAKEME.md)|Review| -|7.|• Third Git Session (Git Workflow :muscle:)
• Map, reduce, filter
• Arrow functions|[Reading Week 7](https://github.com/HackYourFuture/JavaScript/tree/master/Week7)|[Homework Week 7](https://github.com/HackYourFuture/JavaScript/tree/master/Week7/MAKEME.md)|Review| -|8.|• (re)writing data structures (in JSON)
• Closures
• Promises
|[Reading Week 8](https://github.com/HackYourFuture/JavaScript/tree/master/Week8/README.md)|[Homework Week 8](https://github.com/HackYourFuture/JavaScript/tree/master/Week8/MAKEME.md)|Review| -|9.| • Object Literals (and other patterns)
TEST :boom:|[Reading Week 9](https://github.com/HackYourFuture/JavaScript/blob/master/Week9/README.md)|[Homework Week 9](https://github.com/HackYourFuture/JavaScript/blob/master/Week9/MAKEME.md)|[Review](https://github.com/HackYourFuture/JavaScript/blob/master/Week9/REVIEW.md)| +|0.|Preparation for your first JavaScript session|[Pre-reading](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week0)|-| +|1.|• Intro JavaScript (What is it, where can you use it for)
• Variables [var, let, const]
• Basic Data types [Strings, Numbers, Arrays]
• Operators|[Reading Week 1](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week1/README.md) | [Homework Week 1](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week1/MAKEME.md)|[Review](https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week1/REVIEW.md)| +|2.|• Advanced data types [Objects]
• Conditions
• Statements vs Expressions
• Loops (for/while)
• Functions
• Naming conventions|[Reading Week 2](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week2/README.md)|[Homework Week 2](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week2/MAKEME.md)|[Review](https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week2/REVIEW.md)| +|3.|• Closures
• Scope
• Array Manipulations
• Basic DOM manipulations [img src, innerHTML]
• Code commenting|[Reading Week 3](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week3)|[Homework Week 3](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week3/MAKEME.md)|[Review](https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week3/REVIEW.md)| +|4.|• JSON
• Code debugging using the browser
• Functions + JSON/Arrays
• Code flow (order of execution)
• (capturing user input)
• Structuring code files|[Reading Week 4](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week4)|[Homework Week 4](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week4/MAKEME.md)|[Review](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week4/REVIEW.md)| +|5.|• Events
• Callbacks
• XHTTP Requests
• API calls|[Reading Week 5](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week5)|[Homework Week 5](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week5/MAKEME.md)|[Review](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week5/REVIEW.md)| +|6.|• Async VS Sync
• Polling
• Structure for a basic SPA
TEST :boom:|[Reading Week 6](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week6)|[Homework Week 6](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week6/MAKEME.md)|Review| +|7.|• Map, reduce, filter
• Arrow functions|[Reading Week 7](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week7)|[Homework Week 7](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week7/MAKEME.md)|Review| +|8.|• (re)writing data structures (in JSON)
• Closures
• Promises
|[Reading Week 8](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week8/README.md)|[Homework Week 8](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week8/MAKEME.md)|Review| +|9.| • Object Literals (and other patterns)
TEST :boom:|[Reading Week 9](https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week9/README.md)|[Homework Week 9](https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week9/MAKEME.md)|[Review](https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week9/REVIEW.md)| __Kind note:__ -We expect you to __always__ come prepared to the class on Sunday. +We expect you to __always__ come prepared each class. ## Module goals: @@ -36,6 +36,4 @@ A tool capable of loading a JSON file and representing it in the DOM A web app with external data source using at least one API 《〠_〠》 ### Overall -A good understanding of all the above mentioned topics. Want to check your Knowledge? Go through the [JavaScript Fundamentals README](https://github.com/HackYourFuture/JavaScript/tree/master/fundamentals) and research/ ask for help (Slack!) with the concepts that are not entirely clear. - - +A good understanding of all the above mentioned topics. Want to check your Knowledge? Go through the [JavaScript Fundamentals README](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/fundamentals) and research/ ask for help (Slack!) with the concepts that are not entirely clear. diff --git a/Student-Notes.md b/Student-Notes.md new file mode 100644 index 000000000..3f74d4ff0 --- /dev/null +++ b/Student-Notes.md @@ -0,0 +1,35 @@ +# Week 1 + +* + +# Week 2 + +* + +# Week 3 + +* + +# Week 4 + +* + +# Week 5 + +* + +# Week 6 + +* + +# Week 7 + +* + +# Week 8 + +* + +# Week 9 + +* diff --git a/Week0/README.md b/Week0/README.md index e45bb72ad..2372c02af 100644 --- a/Week0/README.md +++ b/Week0/README.md @@ -2,7 +2,6 @@ ``` In week one we will discuss the following topics: -• The first part of the day Unmesh will talk about CLI (Command Line Interface) • Intro JavaScript (What is it, where can you use it for) • Variables [var, let, const] • Basic Data types [Strings, Numbers, Arrays, Booleans] @@ -11,14 +10,7 @@ In week one we will discuss the following topics: ### Here are resources that we like you to read as a preparation for the coming lecture: -Please watch the following parts of the course, [Programming Foundations Fundamentals](https://www.lynda.com/Programming-Foundations-tutorials/Welcome/83603/90426-4.html) on Lynda.com (if you don't have access to Lynda yet ask Gijs): - -Only watch the below chapters: - -0. Introduction -1. Programming Basics -2. Core Programming Syntax -3. Variables and Data Types +- Watch these videos that give you an introduction to Javascript: https://drive.google.com/file/d/1UJ7NMtamP6kX2XIXvAp-1sGdjEBNfyDK/view?usp=sharing (186MB download, do not view on Mobile Data!) - Read this ~ http://speakingjs.com/es5/ch01.html read up to and including the *Strings* chapter (it’s okay if you don’t understand all of it yet, we will cover these concepts in class as well. Do make sure to write or document the questions you have so we can discuss them in class) @@ -26,6 +18,6 @@ Only watch the below chapters: - Helpful resource: http://jsbooks.revolunet.com/ (here you can find tons of free JavaScript books online) -:star: You can also already go through the [review](https://github.com/HackYourFuture/JavaScript/blob/master/Week1/REVIEW.md) of the upcoming lecture. +:star: You can also already go through the [review](/Week1/REVIEW.md) of the upcoming lecture. _Please go through the material and come to class prepared!_ diff --git a/Week1/MAKEME.md b/Week1/MAKEME.md index d02722eb4..0b3ec579e 100644 --- a/Week1/MAKEME.md +++ b/Week1/MAKEME.md @@ -1,37 +1,12 @@ ## Homework week 1: ->[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week1/README.md) you find the readings you have to complete before the second lecture. - -We covered a bit of command line usage in the first class and got a program running which is great. If you need a refresher for the command line please have a look here: https://github.com/HackYourFuture/CommandLine - ## Before you start with the homework: -1. Watch: [What is programming](https://www.khanacademy.org/computing/computer-programming/programming/intro-to-programming/v/programming-intro) Just watch the 2 min video, you do not have to do the entire JavaScript course (It could be useful later on though). -2. Please watch the following parts of the course, [Programming Foundations Fundamentals](https://www.lynda.com/Programming-Foundations-tutorials/Welcome/83603/90426-4.html) on Lynda.com (if you don't have access to Lynda yet ask Gijs): - 0. Introduction - 1. Programming Basics - 2. Core Programming Syntax - 3. Variables and Data Types - -## Step 1: Command Line +1. Watch: [What is programming](https://www.khanacademy.org/computing/computer-programming/programming/intro-to-programming/v/programming-intro) Just watch the 2 min video, __you do not__ have to do the entire JavaScript course (It could be useful later on though). -1. Create a `.js` file that prints `Hello` when you run it from the command line. (Hint: `node` is the program that can run your JavaScript files.) - -``` -Write commands to do following: -1. create a directory. Enter a directory. Create an empty file named blank. - 2. Then write the content `"Hello"` five times to the file greetings.txt. - Then copy the file greetings.txt and paste its contents into 1.txt, 2.txt, 3.txt, 4.txt and 5.txt. - 3. Then write the text "cat" to pets.txt - Then append the text "dog" to pets.txt - Then append the text "hamster" to pets.txt - 4. Then write the text "cat" to commands.txt - Then append the text "ls" to commands.txt - Then append the text "pwd" to commands.txt - 5. Then find unique strings from these two files pets.txt and commands.txt - and store the unique strings in lovelyCommands.txt -``` +## Step 1: **Some freeCodeCamp challenges (10 hours):** +On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.org/map) exercises up and until the __"Shopping List"__ exercise (there are some topics we did not cover but you can do it). ## Step 2: JavaScript @@ -39,15 +14,15 @@ Write commands to do following: 1. Declare a variable `x` and initialize it with an integer. -2. How do you round the number 7.25, to the nearest integer? +2. How do you round the number 7.25, to the nearest whole number? 3. Create a array called `colors` with the strings red, green and blue inside. -4. How can you find the length of the string you just created? +4. How can you find the length of the object you just created? 5. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type. For example: - ```js + let x = 9; let y = 'Hello'; @@ -55,35 +30,15 @@ For example: console.log('SAME TYPE'); } - ``` 6. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the new value of `x`? -7. Write a program to answer the following questions: -* Can you store multiple types in an array? Numbers and strings? -* Can you compare inifities? (Not in Eyad's world) - does 6/0 == 10/0? How can you test this? - -### Step 3: **Some freeCodeCamp challenges (10 hours):** - -On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.com/challenges/learn-how-free-code-camp-works) exercises up and until the __"Shopping List"__ exercise (there are some topics we did not cover but you can do it). +>[Here](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week1/README.md) you find the readings you have to complete before the second lecture. ### How to hand in Homework: ``` -steps: -• Create a Github account -• Create a new repository (name it something like hyf-javascript1) make sure you select the option: initialize with README -• inside this repository create a folder "week1" -• Upload the files you created on your computer inside the week1 folder, write a description for this “commit” -• Open the file in your README to check if this all worked - -• Create a new repository "hyf-javascript1". Also create a new folder "week1" inside this repository. +How to hand in your homework: +• Upload your homework in your "sha-javascript1" Github repository. Make sure to create a new folder "week1" first. • Upload your homework files inside the week1 folder and write a description for this “commit”. -• Your hyf-javascript1/week1 should now contain all your homework files. +• Your sha-javascript1/week1 should now contain all your homework files. • Place the link to your repository folder in Trello. -``` - -### Hint -If you solve the FreeCodeCamp challenges and they are new concepts to you and you would like to take a look at them later on in the program, Copy your answers from FCC in a .js file and upload them to Github in a repository for future reference. In this way you build your own little documentation, if you look back at them first try to understand what it does before you run them. - -:star: Additional resources and review: [here](https://github.com/HackYourFuture/JavaScript/tree/master/Week1/REVIEW.md) (work in progress):star: - diff --git a/Week1/README.md b/Week1/README.md index 1d0d9534b..1d4415e83 100644 --- a/Week1/README.md +++ b/Week1/README.md @@ -10,8 +10,15 @@ In week two we will discuss the following topics: • Naming conventions ``` -### Here are resources that we like you to read as a preparation for the coming lecture: +### Here are resources that we like you to read and watch as a preparation for the coming lecture: +Watch these videos to solidify understanding of arrays and strings (from last unit): +https://www.khanacademy.org/computing/computer-programming/programming/arrays/p/intro-to-arrays +https://www.youtube.com/watch?v=eghr0_XS5HQ + +Material to read: +- 'Loops and iteration' at [MDN] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration +- 'Functions' at [MDN] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions - 'Loops' of [_A Smarter Way To Learn JavaScript_](https://github.com/Sharique-Hasan/SaylaniBatch2-JavaScript/blob/master/A%20Smarter%20Way%20to%20Learn%20JavaScript.pdf) : Chapters 18-20 - 'Functions' of [_A Smarter Way To Learn JavaScript_](https://github.com/Sharique-Hasan/SaylaniBatch2-JavaScript/blob/master/A%20Smarter%20Way%20to%20Learn%20JavaScript.pdf) : Chapters 35 - 38 - Functions ~ http://eloquentjavascript.net/03_functions.html @@ -19,6 +26,6 @@ In week two we will discuss the following topics: - 'Conditions' of [_A Smarter Way To Learn JavaScript_](https://github.com/Sharique-Hasan/SaylaniBatch2-JavaScript/blob/master/A%20Smarter%20Way%20to%20Learn%20JavaScript.pdf) : Chapters 10 - 14 - Program structure ~ http://eloquentjavascript.net/02_program_structure.html -:star: You can also already go through the [review](https://github.com/HackYourFuture/JavaScript/blob/master/Week2/REVIEW.md) of the upcoming lecture. +:star: You can also already go through the [review](/JavaScript/blob/master/Week2/REVIEW.md) of the upcoming lecture. _Please go through the material and come to class prepared!_ diff --git a/Week1/REVIEW.md b/Week1/REVIEW.md index 44335f515..4a51b9366 100644 --- a/Week1/REVIEW.md +++ b/Week1/REVIEW.md @@ -2,42 +2,12 @@ ``` This review covers: -• some commands thought by Unmesh in class today • Intro JavaScript (What is it, where can you use it for) • Variables [var, let, const] • Basic Data types [Strings, Numbers, Arrays] • Operators ``` -## CLI -``` -pwd : present working directory -ls : List files in the directory -cd : change the directory -touch: Create an empty file -echo : display the string -echo -n : Display the string without newline -echo “something” > file : Redirect the output of echo and create file -echo “another thing” >> file : Append the string to the file -mkdir: make a new directory -cd ~ : home -cd - : previous directory -cd .. : parent directory -ls -a : List all files including hidden files -cd / : change to the root directory -cat : Concatenate the file line by line and display it on the terminal -less: Print the big file line by line -vim : open the editor with {a: to go to the insert mode, :wq to write and quit } -for var in {START..END}; do ; ;..; ; done -head : display the first 10 lines of file -tail : display the last 10 lines of file -head -n : display first n lines of file -tail -n : display last n lines of file -man : Display manual of the COMMAND -``` - -:star: Highly recommended :star: :take a look at the Command Line [repository](https://github.com/HackYourFuture/CommandLine) and especially review the preparations of the first lecture: https://github.com/HackYourFuture/CommandLine/blob/master/Lecture-1.md - ## Variables A "variable" is a place where you can store information, such as a string, or a number. New variables in JavaScript are declared using one of three keywords: let, const, or var. @@ -253,6 +223,8 @@ More about [comparison operators](https://developer.mozilla.org/en-US/docs/Web/J More about [Arithmetic_Operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#.25_.28Modulus.29) +More about [Operator Precedence](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence) + ### Logical operators * AND `&&` @@ -268,7 +240,7 @@ x !== y // -> true More about [logical operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators) -### Operator precedence +### Compound assignment operators There are compound assignment operators such as +=. The following two assignments are equivalent: diff --git a/Week1/resources/calc.html b/Week1/resources/calc.html new file mode 100644 index 000000000..c3759b395 --- /dev/null +++ b/Week1/resources/calc.html @@ -0,0 +1,124 @@ + + + + + calc + + + + + + + +
+
+
+
+ 1 +
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
+
+
-
+
*
+
/
+
+/-
+
=
+
+ + + + + + diff --git a/Week2/MAKEME-PT2.md b/Week2/MAKEME-PT2.md new file mode 100644 index 000000000..71588c0fc --- /dev/null +++ b/Week2/MAKEME-PT2.md @@ -0,0 +1,28 @@ +## Homework Week 2 + +>[Here](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week2/README.md) you find the readings you have to complete before the third lecture. + +## Step 0: Play a game! +One of the teachers from HackYourFuture made this game that you play by writing Javascript. Try it out! +[Rover The Robot](http://roverjs.com/) + +## Step 1: Practice Javascript + +Make sure you know everything from the FreeCodeCamp course +[CodeAcademy](https://www.codecademy.com/en/tracks/javascript-combined) + +Complete these exercises +* Search Text for Your Name +* Dragon Slayer +* Choose Your Own Adventure 2 +* Contact List +* Building Your Address Book + +## Step 2: Practice Logic + +Sign up to CodeWars to practice your Javascript skills: +[CodeWars](https://www.codewars.com) + +Complete as many challenges as you can. Some of them will be hard but try your best and look at the solutions when you complete them. These exercises are to test your logical skills as well as your Javascript skills. + + diff --git a/Week2/MAKEME.md b/Week2/MAKEME.md index efec8f539..dae6a41d2 100644 --- a/Week2/MAKEME.md +++ b/Week2/MAKEME.md @@ -1,23 +1,18 @@ ## Homework Week 2 ->[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week2/README.md) you find the readings you have to complete before the third lecture. +>[Here](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week2/README.md) you find the readings you have to complete before the third lecture. -## Step 1: Recap/Read +## Step 1: Watch -- Have a look at [The Secret Life of JavaScript Primitives](https://javascriptweblog.wordpress.com/2010/09/27/the-secret-life-of-javascript-primitives/) -- Go through the review of [last week](https://github.com/HackYourFuture/JavaScript/blob/master/Week1/REVIEW.md) (Work in progress, update this week :wrench:) -- Go through the review of [this week](https://github.com/HackYourFuture/JavaScript/blob/master/Week2/REVIEW.md) (work in progress, update this week :nut_and_bolt:) +1. If you haven't done already, watch: [What is programming](https://www.khanacademy.org/computing/computer-programming/programming/intro-to-programming/v/programming-intro) Just watch the 2 min video, you do not have to do the entire JavaScript course (It could be useful later on though). -## Step 2: Watch +2. If you want a refresher on Functions you should see [this video](https://www.youtube.com/watch?v=5nuqALOHN1M). -1. If you haven't done already, watch: [What is programming](https://www.khanacademy.org/computing/computer-programming/programming/intro-to-programming/v/programming-intro) Just watch the 2 min video, you do not have to do the entire JavaScript course (It could be useful later on though). -2. Please watch the following parts of the course, [Programming Foundations Fundamentals](https://www.lynda.com/Programming-Foundations-tutorials/Welcome/83603/90426-4.html) on Lynda.com (if you don't have access to Lynda yet ask Gijs): -
4. Writing Conditional Code -
5. Modular Code -
6. Iteration: Writing Loops -
7. More About Strings -
8. Collections -
11. When Things Go Wrong +3. If you want a refresher on Objects you should see [this video](https://www.youtube.com/watch?v=mgwiCUpuCxA) + +## Step 2: **Some freeCodeCamp challenges (10 hours):** + +On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.org/map) exercises up and until the __"Iterate with JavaScript While Loops"__ exercise (there are some topics we did not cover but you can do it). ## Step 3: JavaScript > For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference @@ -26,73 +21,32 @@ 2. Create a function named `colorCar` that receives a color, and prints out, "a red car" for example. (Hint: put it in your file and run it like before.) -3. Create an object and a function that takes the object as a parameter and prints out all of its names and values. - -4. Create a function named `vehicleType` that receives a color, and a code, 1 for car, 2 for motorbike. And prints "a blue motorbike" for example when called as `vehicleType("blue", 2)` +3. Create a function named `vehicleType` that receives a color, and a code, 1 for car, 2 for motorbike. And prints "a blue motorbike" for example when called as `vehicleType("blue", 2)` -5. Can you write the following without the `if` statement, but with just as a single line with `console.log(...);`? +4. Can you write the following without the `if` statement, but with just as a single line with `console.log(...);`? ```js -if (3 == 3) { +if (3 === 3) { console.log("true") } else { console.log("false") } ``` -6. Create a function called `vehicle`, like before, but takes another parameter called age, so that `vehicle("blue", 1, 5)` prints "a blue used car" - -7. Make a list of vehicles, you can add `"motorbike"`, `"caravan"`, `"bike"`, or more. - -8. How do you get the third element from that list? - -9. Change the function `vehicle` to use the list of question 4. So that `vehicle("green", 3, 1)` prints "a green new caravan". - -10. Use the list of vehicles to write an advertisement. So that it prints something like: `"Amazing Joe's Garage, we service cars, motorbikes, caravans and bikes."`. (Hint: use a `for` loop.) +5. Create a function called `vehicle`, like before, but takes another parameter called age, so that + * `vehicle("blue", 1, 2)` prints "a blue used car". + * `vehicle("blue", 1, 1)` prints "a blue new car". -11. What if you add one more vehicle to the list, can you have that added to the advertisement without changing the code for question 7? +6. Make a list of vehicles, you can add `"motorbike"`, `"caravan"`, `"bike"`, or more. -12. Create an empty object +7. How do you get the third element from that list? -13. Create a function that takes two objects as parameters and compares them. You will actually need to write two functions — one that compares with `==` and one that compares with `===`. Remember that objects can have objects inside of them so you'll need to find a way to compare every element of every object (types and values). For example: +8. Change the function `vehicle` to use the list of question 6. So that `vehicle("green", 3, 1)` prints "a green new caravan". -```js - var obj1 = { - a: 1, - b: 'this is the letter b', - c: { foo: 'what is a foo anyway', - bar: [1,2,3,4] - } - } - - var obj2 = { - a: '1', - b: 'this is the letter b', - c: { foo: 'what is a foo anyway', - bar: [1,2,3,4] - } - } -``` - - In our example we'll say that `obj1 == obj2` is `true` and `obj1 === obj2` is `false`. Make sure you can see why before you write any code! - - Note: give this exercise your best shot but don’t spend more than, say, one hour on it. - -14. We saw that we can pass functions as arguments to other functions. Your task is to write a function that takes another function as an argument and runs it. - -```js - function foo(func) { - // What to do here? - } - - function bar() { - console.log('Hello, I am bar!'); - } - - foo(bar); -``` +9. Use the list of vehicles to write an advertisement. So that it prints something like: `"Amazing Joe's Garage, we service cars, motorbikes, caravans and bikes."`. (Hint: use a `for` loop.) +10. What if you add one more vehicle to the list, can you have that added to the advertisement without changing the code for question 9? -15. Write some code to test two arrays for equality using `==` and `===`. Test the following: +11. Write some code to test two arrays for equality using `==` and `===`. Test the following: ```js var x = [1,2,3]; @@ -103,27 +57,8 @@ if (3 == 3) { What do you think will happen with `x == y`, `x === y` and `z == y` and `z == x`? Prove it! > Don't cheat! Seriously - try it first. - - -Check out this [Fiddle](http://jsfiddle.net/jimschubert/85M4z/). You need to open your browser’s Developer Tools to see the console output. Press the Run button in the upper right corner to run the code. - -More insights from this [Stack Overflow question](http://stackoverflow.com/questions/22395357/how-to-compare-two-arrays-are-equal-using-javascript). - - -16. Take a look at the following code: -```js - var o1 = { foo: 'bar' }; - var o2 = { foo: 'bar' }; - var o3 = o2; - -``` - - Show that changing `o2` changes `o3` (or not) and changing ~~`o2` changes `o3`~~ `o1` changes `o3`(or not). - - Does the order that you assign (`o3 = o2` or `o2 = o3`) matter? {Jim Cramer: ???} - -17. What does the following code return? (And why?) +12. What does the following code return? (And why?) ```js let bar = 42; typeof typeof bar; @@ -132,24 +67,13 @@ typeof typeof bar; > ‘Coerce' means to try to change - so coercing `var x = '6'` to number means trying to change the type to number temporarily. -## Step 4: **Finish basic freeCodeCamp challenges:** - -Go back to FreeCodeCamp, start where you left of and finish the rest of the Basic JavaScript challenges. - -Please make sure you REALLY understand the exercises below: -- https://www.freecodecamp.com/challenges/multiply-two-decimals-with-javascript -- https://www.freecodecamp.com/challenges/store-multiple-values-in-one-variable-using-javascript-arrays -- https://www.freecodecamp.com/challenges/build-javascript-objects -- https://www.freecodecamp.com/challenges/add-new-properties-to-a-javascript-object -- https://www.freecodecamp.com/challenges/delete-properties-from-a-javascript-object - ``` How to hand in your homework: -• Upload your homework in your "hyf-javascript1" Github repository. Make sure to create a new folder "week2" first. +• Upload your homework in your "sha-javascript1" Github repository. Make sure to create a new folder "week2" first. • Upload your homework files inside the week2 folder and write a description for this “commit”. -• Your hyf-javascript1/week2 should now contain all your homework files. +• Your sha-javascript1/week2 should now contain all your homework files. • Place the link to your repository folder in Trello. ``` -:star: Additional resources and review: [here](https://github.com/HackYourFuture/JavaScript/tree/master/Week2/REVIEW.md) (work in progress):star: +:star: Additional resources and review: [here](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week2/REVIEW.md) (work in progress):star: diff --git a/Week2/README.md b/Week2/README.md index ed33a643d..74f8711ab 100644 --- a/Week2/README.md +++ b/Week2/README.md @@ -2,8 +2,6 @@ ``` In week three we will discuss the following topics: -• CLI (Command Line Interface) -• Closures • Scope • Array Manipulations • Basic DOM manipulations [img src, innerHTML] @@ -12,12 +10,13 @@ In week three we will discuss the following topics: ### Here are resources that we like you to read as a preparation for the coming lecture. -- Closures: http://javascriptissexy.com/understand-javascript-closures-with-ease/ -- https://developer.mozilla.org/en/docs/Web/JavaScript/Closures -- [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype) +- [Common Array Methods Video](https://www.youtube.com/watch?v=MeZVVxLn26E) +- [All of the array methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype) +- [What is the DOM](https://www.youtube.com/watch?v=iBQEzanrjeg) Refresher: +* (Javascript Book)[https://github.com/Sharique-Hasan/SaylaniBatch2-JavaScript/blob/master/A%20Smarter%20Way%20to%20Learn%20JavaScript.pdf] * Objects (*important to really understand them, read this if you are unsure! You may also read chapters 72, 73 and 74 if you have time and want to learn more*):
Chapters 70-71, 75 diff --git a/Week2/REVIEW.md b/Week2/REVIEW.md index 8cc7338e9..ac1c5da42 100644 --- a/Week2/REVIEW.md +++ b/Week2/REVIEW.md @@ -33,7 +33,7 @@ This review covers: |0|0|1| |1|1|1| -So you can say that false in combination with `&&` always returns true +So you can say that false in combination with `&&` always returns false ```js true && false //-> false false && true //-> false diff --git a/Week3/MAKEME.md b/Week3/MAKEME.md index 2ed148bc1..794353978 100644 --- a/Week3/MAKEME.md +++ b/Week3/MAKEME.md @@ -1,28 +1,36 @@ ## Homework Week 3 ->[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week3/README.md) you find the readings you have to complete before the fourth lecture. +>[Here](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week3/README.md) you find the readings you have to complete before the fourth lecture. ## Step 0 review: -- Go through the review of [the first week](https://github.com/HackYourFuture/JavaScript/blob/master/Week1/REVIEW.md) (Work in progress, update this week :wrench:) -- Go through the review of [the second week](https://github.com/HackYourFuture/JavaScript/blob/master/Week2/REVIEW.md) (work in progress, update this week :nut_and_bolt:) -- Go through the review of [the third week](https://github.com/HackYourFuture/JavaScript/blob/master/Week3/REVIEW.md) +- Go through the review of [the first week](https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week1/REVIEW.md) (Work in progress, update this week :wrench:) +- Go through the review of [the second week](https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week2/REVIEW.md) (work in progress, update this week :nut_and_bolt:) +- Go through the review of [the third week](https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week3/REVIEW.md) ## Step 1: Implement feedback -Your fellow students have provided you with feedback in Trello. Your teachers have provided you with feedback in issues in Github. +Your teachers have provided you with feedback in issues in Github. -- Implement both feedback from Trello and Github. +- Implement feedback from Github - Check on one of your fellow students code and issues and see if her or she implemented their feedback correctly. If there are some things that can be improved make an issue suggesting further improvements. If you think that the feedback has been implemented correctly create a issue saying something like: "nice work you can clear your issues". -## Step 2: Reorganize your Github +## Step 2: **FreeCodeCamp challenges:** -Your Github should contain two repositories called hyf-javascript1 and hyf-commandline . Inside the JavaScript repository you should have three folders, called week1, week2, and week3 (or something similar). Inside these folders you should have the different assignments (a file per exercises). Ty and find proper names for the exercises that reflect somehow what is going on in the code. Avoid using spaces in your file names, this makes it harder to "run" you files. Also make sure that all your JavaScript files have a .js extension. +- https://www.freecodecamp.com/challenges/declare-javascript-objects-as-variables +- https://www.freecodecamp.com/challenges/make-instances-of-objects-with-a-constructor-function +- https://www.freecodecamp.com/challenges/make-unique-objects-by-passing-parameters-to-our-constructor +- https://www.freecodecamp.com/challenges/make-object-properties-private +- https://www.freecodecamp.com/challenges/multiply-two-decimals-with-javascript +- https://www.freecodecamp.com/challenges/store-multiple-values-in-one-variable-using-javascript-arrays +- https://www.freecodecamp.com/challenges/build-javascript-objects +- https://www.freecodecamp.com/challenges/add-new-properties-to-a-javascript-object +- https://www.freecodecamp.com/challenges/delete-properties-from-a-javascript-object ## Step 3: Custom DOM manipulation challenge :mortar_board: 1. Open a new js file and start by declaring an array that contains 10 strings. These strings should be of book titles you have read (or made up) and be lowercase without spaces or special characters so that you can use these later as Id's. (Example: Harry Potter's - The Chamber of Secrets -> `harry_potter_chamber_secrets`). -2. Create a basic html file called index.html and use it to load the js file, confirm the console.log show the array. (This is for debugging and making sure everything is in order. Delete it later when you're done :)) +2. Create a basic html file called index.html and use it to load the js file, confirm the console.log() show the array. (This is for debugging and making sure everything is in order. You can delete the console.log() later when you're done :)) 3. Make a function (or functions) that generate a `ul` with `li` elements for each book ID in the array using a for loop. @@ -36,27 +44,18 @@ Your Github should contain two repositories called hyf-javascript1 and hyf-comma ``` How to hand in your homework: -• Upload your homework in your "hyf-javascript1" Github repository. Make sure to create a new folder "week3" first. +• Upload your homework in your "sha-javascript1" Github repository. Make sure to create a new folder "week3" first. • Upload your homework files inside the week3 folder and write a description for this “commit”. -• Your hyf-javascript1/week3 should now contain an index.html, main.css and a script.js file (and the images folder) +• Your sha-javascript1/week3 should now contain an index.html, main.css and a script.js file (and the images folder) • Place the link to your repository folder in Trello. ``` - -## Step 4: **FreeCodeCamp challenges:** - -- https://www.freecodecamp.com/challenges/declare-javascript-objects-as-variables -- https://www.freecodecamp.com/challenges/make-instances-of-objects-with-a-constructor-function -- https://www.freecodecamp.com/challenges/make-unique-objects-by-passing-parameters-to-our-constructor -- https://www.freecodecamp.com/challenges/make-object-properties-private - - And just for fun ... https://www.freecodecamp.com/challenges/sum-all-numbers-in-a-range ### :boom: Bonus homework :boom: the Bonus homework for this week (for those of you want an extra challenge) do the following: - Sign up on codewars.com -- In you account setting under “clan” write “Hack Your Future” +- In you account setting under “clan” write “Social Hackers Academy” - Go do the challenges in the following playlist: https://www.codewars.com/collections/fun-fun-fundamentals Codewars is really a lot of fun, and you can compete against each other who has the most points :trollface: @@ -66,7 +65,7 @@ Please note, there are various challenges all sorted on difficultly called KIU. enjoy! -:star: Additional resources and review: [here](https://github.com/HackYourFuture/JavaScript/tree/master/Week3/REVIEW.md) (work in progress):star: +:star: Additional resources and review: [here](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week3/REVIEW.md) (work in progress):star: diff --git a/Week3/README.md b/Week3/README.md index 21fc6d059..41b354fc4 100644 --- a/Week3/README.md +++ b/Week3/README.md @@ -2,20 +2,21 @@ ``` In week four we will discuss the following topics: -• Git • JSON • Code debugging using the browser -• Functions + JSON/Arrays +• JSON/Arrays • Code flow (order of execution) • (capturing user input) • Structuring code files ``` -### Here are resources that we like you to read as a preparation for the coming lecture. +### Here are resources that we like you to read as a preparation for the coming lecture. - [JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) (MDN) -- In you next lecture **Unmesh** will give you your first Git session, please look through the [GIT](https://github.com/HackYourFuture/Gitrepository) and read the learning goals. -- Chrome DevTools [Debugging](https://developers.google.com/web/tools/chrome-devtools/?utm_source=dcc&utm_medium=redirect&utm_campaign=2016q3) +- [JSON Video](https://www.youtube.com/watch?v=sSL2to7Jg5g) + +- Chrome DevTools [Debugging](https://developers.google.com/web/tools/chrome-devtools/?utm_source=dcc&utm_medium=redirect&utm_campaign=2016q3) +- Chrome DevTools [Video](https://www.youtube.com/watch?v=zv_aOlH8S_o) ### A Refresher from some previous covered topics: @@ -33,4 +34,38 @@ Links to MDN (Mozilla Developer Network) topics: _Please go through the material and come to class prepared!_ +## Requirements +Before class I'd like all of you to have ready the below: + +- Have the latest Chrome Browser version installed +- Go to [themoviedb.org](https://www.themoviedb.org) and create an account (it's free). After login go to your profile settings -> API section and check your API Key (we will use it in class). + + +## HTTP +* [Introduction to HTTP](https://varvy.com/http/basics.html) + + +## Code debugging using the browser / Developer Tools resources + +Have a look at the below resources, courses and videos + +* [Chrome Developer Tools](https://developer.chrome.com/home/devtools-pillar) +* [Chrome DevTools Overview](https://developer.chrome.com/devtools) +* [Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/) +* [Devtools 2017: The Basics of Chrome Developer Tools (Udemy free lesson)](https://www.udemy.com/devtools-2017-the-basics-of-chrome-developer-tools/) +* [Chrome Developer Tools (Devtools) Tutorial Introduction for Beginners (Youtube video)](https://www.youtube.com/watch?v=wcFnnxfA70g) + + +## DOM Manipulation and Events +* [Introduction to the DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction) +* [The Basics of DOM Manipulation in Vanilla JavaScript](https://www.sitepoint.com/dom-manipulation-vanilla-javascript-no-jquery/) +* [JavaScript DOM Tutorial (YouTube Playlist)](https://www.youtube.com/playlist?list=PL4cUxeGkcC9gfoKa5la9dsdCNpuey2s-V) +* [Introduction to events](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events) +* [Event reference](https://developer.mozilla.org/en-US/docs/Web/Events) +* [Javascript Events Tutorial (Youtube video)](https://www.youtube.com/watch?v=e57ReoUn6kM) + +# JSON and fetch() +[JSON Tutorial: Learn JSON in 10 Minutes](https://beginnersbook.com/2015/04/json-tutorial/) +[Introduction to fetch()](https://developers.google.com/web/updates/2015/03/introduction-to-fetch) +[Working with the Fetch API](https://developers.google.com/web/ilt/pwa/working-with-the-fetch-api) diff --git a/Week3/REVIEW.md b/Week3/REVIEW.md index f47595fc2..70aa40127 100644 --- a/Week3/REVIEW.md +++ b/Week3/REVIEW.md @@ -2,18 +2,14 @@ ``` This review covers: -• More CLI -• Scope, closures and 'this' +• Closures and 'this' • Array Manipulations • Basic DOM manipulations • Code commenting ``` -## More CLI -Check out the CLI review here: https://github.com/HackYourFuture/CommandLine/blob/master/Lecture-2.md - ## Scope, closures and 'this' -Scope, closure and 'this' are about *context*. +Closure and 'this' are about *context*. This post explains things really well: [Recommended read by Todd Motto on Scope](https://toddmotto.com/everything-you-wanted-to-know-about-javascript-scope/) diff --git a/Week4/MAKEME.md b/Week4/MAKEME.md index 2e080dc1e..8c4bf0bde 100644 --- a/Week4/MAKEME.md +++ b/Week4/MAKEME.md @@ -1,20 +1,20 @@ # Homework Week 4 ->[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week4/README.md) you find the readings you have to complete before the fifth lecture. +>[Here](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week4/README.md) you find the readings you have to complete before the fifth lecture. -## Step 0: +## Step 0: Give yourself (or your neighbour) a little tap on the shoulder, you've made it to JS2! :muscle: ## Step 1: Some Challenges Let's practice working with Objects and Arrays. Go to FreeCodeCamp and complete all challenges under "Object Oriented and Functional Programming" and the _first four challenges_ under "Basic Algorithm Scripting", up until 'Find the longest word in a string.' -## Step 2: Custom challenge -1. Go to https://api.github.com/orgs/HackYourFuture/repos, you will see a list of the repositories our HYF organization has (yes it's a lot of JSON). +## Step 2: Custom challenge +1. Go to https://api.github.com/orgs/SocialHackersCodeSchool/repos, you will see a list of the repositories our SHA organization has (yes it's a lot of JSON). 2. You can copy the JSON and put it in a string at the top of your `.js` file. Print the name of the 3rd repository in the array to the console. 3. Make a `
    ` with a `
  • ` for each repository name (just like you did with the books in the previous assignment). -4. It should only display the modules that are actually being used in the curriculum at the moment, you of course know which those are, but if you need a reminder you can find them in our [curriculum overview](https://github.com/HackYourFuture/curriculum). +4. It should only display the modules that are actually being used in the curriculum at the moment, you of course know which those are, but if you need a reminder you can find them in our [curriculum overview](https://github.com/SocialHackersCodeSchool/curriculum). 5. Use CSS to divide the page in two columns. The left column will have a list of the names for repository. The right column should have the following information about each repository: the number of `stargazers`, the number of `watchers`, the number of `forks`, the `language` of the repository. -6. place the `avatar_url` (logo) of our organization somewhere on a nice place in your page. +6. place the `avatar_url` (logo) of our organization somewhere on a nice place in your page as an image. ## Step 3: Feedback @@ -44,12 +44,17 @@ Notes: 1. Do not bother to make this work for the `Ratings` property which refers to an object rather than a simple value. 2. It is not necessary to convert property values containing dates or numbers formatted with embedded commas to facilitate sorting for this challenge (but you're welcome to try). You can leave the value 'as is'. --> -:octocat: +:octocat: ``` How to hand in your homework: -• Create a new repository "hyf-javascript2". Also create a new folder "week1" inside this repository. +• Create a new repository "sha-javascript2". Also create a new folder "week1" inside this repository. • Upload your homework files inside the week1 folder and write a description for this “commit”. -• Your hyf-javascript2/week1 should now contain the files of your homework. +• Your sha-javascript2/week1 should now contain the files of your homework. • Place the link to your repository folder in Trello. ``` +## Step 4: DOM exercises + +1. Create a webpage with an empty body. Using JS append an h1 title, 2 paragraphs and between these 2 paragraphs an unordered list (`
      `), with 5 items. Try not to repeat your self ([DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)). You can freely choose your content. + +2. Create a webpage ([check the bootstrap examples for insperation and/or usage](https://v4-alpha.getbootstrap.com/examples/)) with 2 themes, a dark and a light one. Apply the light theme by default by adding the class `light-theme` on the body tag. Put a button on the top of your page with the text `Switch theme!`. OnClick remove `light-theme` and add the `dark-theme` class. Bonus: Instead of the static button text `Switch theme!` try to put the name of the theme that will be applied, ex. `Switch to Dark/Light theme. diff --git a/Week4/README.md b/Week4/README.md index 846bf16d3..0e304ede9 100644 --- a/Week4/README.md +++ b/Week4/README.md @@ -5,7 +5,7 @@ ``` In week five we will discuss the following topics: -• First Git Session +• Json • Events • Callbacks • XHTTP Requests diff --git a/Week5/MAKEME.md b/Week5/MAKEME.md index bbfa48d08..e032e3e9a 100644 --- a/Week5/MAKEME.md +++ b/Week5/MAKEME.md @@ -1,6 +1,6 @@ ## Homework Week 5 ->[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week5/README.md) you find the readings you have to complete before the sixth lecture. +>[Here](https://github.com/SocialHackersCodeSchool/SocialHackersCodeSchool/tree/master/Week5/README.md) you find the readings you have to complete before the sixth lecture. ### Step 0 All share a video or a resource (this can be a drawing, article or a pod cast) that was helpful for you the last few weeks with learning JavaScript. Please share this in the channel of your class in Slack. Also write as small note about what the resource i about and why you think it's so helpful (you can share more than one if you like). @@ -25,9 +25,9 @@ All share a video or a resource (this can be a drawing, article or a pod cast) t The function should generate an array containing values from start value to end value (inclusive). - Then the function should iterate over the array and call the second argument if the array value is divisible by 3 + Then the function should loop over the array and call the third argument if the array value is divisible by 3 - The function should call the second argument if the array value is divisible by 5 + The function should call the fourth argument if the array value is divisible by 5 Both functions should be called if the array value is divisible by both 3 and 5 @@ -44,11 +44,11 @@ All share a video or a resource (this can be a drawing, article or a pod cast) t ``` -2. Please solve this problem using: +2. Please solve this problem: https://www.freecodecamp.com/challenges/repeat-a-string-repeat-a-string - 1. A for loop - 2. A while loop - 3. A do loop + - Solve the problem using a for loop + - Solve the problem using a while loop + - Solve the problem using a do loop 3. Some practice with objects https://www.freecodecamp.com/challenges/construct-javascript-objects-with-functions @@ -95,30 +95,30 @@ Make a website that fetches (= to get) data asynchronously. 2) Add a button (e.g. 'click me') that when clicked `console.logs` 'you clicked me!' -3) Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page] (https://api.github.com/orgs/HackYourFuture/repos) (the one we used last week). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript) +3) Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page] (https://api.github.com/orgs/SocialHackersCodeSchool/repos) (the one we used last week). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript) 4) Display the data that you get from the Github API on your web page. 5) Now link the two together: When you click the button -> get the data from the Github API and display it on your website -6) Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/HackYourFuture/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab. +6) Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/SocialHackersCodeSchool/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab. 7) BONUS: if you look at this: ```js -https://api.github.com/repos/HackYourFuture/CommandLine +https://api.github.com/repos/SocialHackersCodeSchool/CommandLine ``` You can see `CommandLine` in the URL. These are called "query parameters" and let us specify in detail what we want from the API. Play around with this. For example you can make two buttons that either get data for a specific repository, JavaScript or Node.js. Or go even more crazy and make users type in a search box 'JavaScript' and then send that to the API by changing the repository. ``` How to hand in your homework: -• Clone your existing "hyf-javascript2" Github repository. -• Create a new folder "week2" USING THE COMMAND LINE +• Clone your existing "sha-javascript2" Github repository. +• Create a new folder "week2" • Save your homework files inside this folder. -• When you are done with your homework use add/commit and push to upload your homework. +• When you are done with your homework upload your homework to github. • Write a description for your “commit”. -• Your hyf-javascript2/week2 should now contain all your homework files. +• Your sha-javascript2/week2 should now contain all your homework files. Place the link to your repository folder in Trello. ``` diff --git a/Week5/README.md b/Week5/README.md index 1ef448598..c058e5fb5 100644 --- a/Week5/README.md +++ b/Week5/README.md @@ -2,9 +2,7 @@ ``` In week six we will discuss the following topics: -• Second Git Session • Async VS Sync -• Polling • Structure for a basic SPA • There is a TEST the second part of the day ``` @@ -16,10 +14,10 @@ In week six we will discuss the following topics: - [Polling](https://davidwalsh.name/javascript-polling) - [JavaScript Variable Scope and Hoisting Explained](http://javascriptissexy.com/javascript-variable-scope-and-hoisting-explained/) -### This Sunday we have a test :boom: +### This class we have a test :boom: If you feel you need preparation for the test we recommend to do the following: -- Take a look at the topics listed in the [README](https://github.com/HackYourFuture) of this repo (up to and including week 5). +- Take a look at the topics listed in the [README](https://github.com/SocialHackersCodeSchool) of this repo (up to and including week 5). - Review all the _REVIEW.md_ files in every week. - Look up the concepts you are struggling with in your __Smarter Way to Learn JavaScript__ book :books:. - It's also useful to go through the reading material and homework of the last weeks. diff --git a/Week5/REVIEW.md b/Week5/REVIEW.md index 89e85fc3f..89f454729 100644 --- a/Week5/REVIEW.md +++ b/Week5/REVIEW.md @@ -2,7 +2,6 @@ ``` this review covers: -• Git Session • Events • Callbacks • XHTTP Requests diff --git a/Week6/MAKEME.md b/Week6/MAKEME.md index 3eacf6cce..cef4c3354 100644 --- a/Week6/MAKEME.md +++ b/Week6/MAKEME.md @@ -1,15 +1,14 @@ # Homework Week 6 ->[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week6/README.md) you find the readings you have to complete before the seventh lecture. +>[Here](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week6/README.md) you find the readings you have to complete before the seventh lecture. ### Step 1: Feedback -Give feedback on `step 3` of `week 5` to one of your fellow students (do this by creating issues in Github). +Give feedback on `step 3` of `week 5` to one of your fellow students. You should comment on Trello to do this. ### Step 2: Fix issues and API -- Fix the issues from the last week and make sure you explain how you fixed the issue in a comment (or commit message) - +- You'll recieve feedback from one of our teachers. Make the changes and then continue to the next step. ### Step 3: SPA :sweat_drops: You are going to write a SPA (Single Page Application) that uses the [Github API](https://developer.github.com/guides/getting-started/). Make sure that your app uses a logical pattern just like [this codepen](http://codepen.io/Razpudding/pen/MmVpeW). @@ -22,7 +21,7 @@ Make a website that fetches (= to get) data asynchronously. 2) Add a button (e.g. 'click me') that when clicked `console.logs` 'you clicked me!' -3) Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page] (https://api.github.com/orgs/HackYourFuture/repos). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript) +3) Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page] (https://api.github.com/orgs/SocialHackersCodeSchool/repos). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript) 4) Display the data that you get from the Github API on your web page. @@ -33,12 +32,12 @@ Cool we are back where we left of. 6) Take a look at this: ```js -https://api.github.com/repos/HackYourFuture/CommandLine +https://api.github.com/repos/SocialHackersCodeSchool/CommandLine ``` -7) Make a function which takes a single argument. The function should make an XHR request to `https://api.github.com/repos/HackYourFuture/[SearchTerm]` where the search term will be the argument. This argument will be the input the user has given you, so make sure that when the user clicks the button you call this function with the argument. +7) Make a function which takes a single argument. The function should make an Fetch request to `https://api.github.com/repos/SocialHackersCodeSchool/[SearchTerm]` where the search term will be the argument. This argument will be the input the user has given you, so make sure that when the user clicks the button you call this function with the argument. -8) Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/HackYourFuture/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab. +8) Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/SocialHackersCodeSchool/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab. - Make sure you handle user input well. That means you need to think about empty input, and input that doesn't yield any results. @@ -69,33 +68,13 @@ So for example, we have teams in our organization. You can find out who are in t Anyway, endless fun and possibilities. Need inspiration, check out the Github API documentation. Oh and please make it look nice (hint: use the stuff you learned in HTML/CSS)! - -### Step 4: Git branching homework - -1) Use the unmeshvrije/MyFirst repository (the one you cloned) for this homework. - -2) Make a branch. - -3) Name it YOUR-GITHUB-NAME-dev - -4) Create a file commands.txt in your branch. - -5) Add bash commands that you have learnt with descriptions - -6) Then git add, commit and push them in a remote branch. - -**Do not merge the changes to master branch. - -** Do not make any changes to master branch. - - __Bonus__: Write a function takes this array `['a', 'b', 'c', 'd', 'a', 'e', 'f', 'c']` and returns an array which only has unique values in it (so it removes the duplicate ones). Make it a 'smart' algorithm that could do it for every array (only strings/number). Try to make it as fast as possible! ``` How to hand in your homework: -• Upload your homework in your "hyf-javascript2" Github repository. Make sure to create a new folder "week3" first. +• Upload your homework in your "sha-javascript2" Github repository. Make sure to create a new folder "week3" first. • Upload your homework files inside the week3 folder and write a description for this “commit”. -• Your hyf-javascript2/week3 should now contain an index.html, main.css and a script.js file (and the images folder) +• Your sha-javascript2/week3 should now contain an index.html, main.css and a script.js file (and the images folder) • Place the link to your repository folder in Trello. ``` diff --git a/Week6/README.md b/Week6/README.md index f14c3231b..ec9427fb7 100644 --- a/Week6/README.md +++ b/Week6/README.md @@ -2,7 +2,6 @@ ``` In week seven we will discuss the following topics: -• Git Workflow :muscle: • Map, reduce filter • Arrow functions ``` @@ -13,8 +12,6 @@ Some nice resources about map, filter, reduce - :dizzy: [Fun fun functional](https://www.youtube.com/playlist?list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84) :dizzy: Check the first 3-4 videos. - Wes Bos' awesome free tutorials. Just make a free account and do Array Cardio #1 [here](https://javascript30.com/) -- Check out this video of Daan to see how we use Git Workflow to hand in Homework (from now on): https://www.youtube.com/watch?v=-o0yomUVVpU&index=2&list=PLVYDhqbgYpYUGxRdtQdYVE5Q8h3bt6SIA - _Please go through the material and come to class prepared!_ diff --git a/Week7/MAKEME.md b/Week7/MAKEME.md index 43b10120b..1af054a37 100644 --- a/Week7/MAKEME.md +++ b/Week7/MAKEME.md @@ -2,26 +2,22 @@ >[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week7/README.md) you find the readings you have to complete before the eighth lecture. -## Step 1: Git Homework - -[Make these assignments](https://github.com/HackYourFuture/Git/blob/master/Lecture-3.md). For handing in homework follow the Forking workflow that is described in our lecture-3.md file of HackYourFuture’s Git repository (there is also a video that explains this). - -## Step 2: Give feedback on Step 3 and 4 of last weeks homework. +## Step 1: Give feedback on Step 3 and 4 of last weeks homework. Give feedback on the SPA (Github API) and git branching homework of one of you fellow students. Please provide the feedback in an issue. -## Step 3: Issues +## Step 2: Issues -- Solve all your Git issues. DO NO CLOSE AN ISSUE WITHOUT AN EXPLANATION OR CODE COMMIT REFERENCING THAT ISSUE. +- Fix any feedback that you got from Week 5 or 6 -## Step 4: map, filter, reduce +## Step 3: map, filter, reduce - Add map, filter, reduce to your existing app to build an application that loads data from github, filters out based on certain value, map->reduces to a data object and render that object to the dom (using map again). - For example you can try to use map, filter and reduce to show the most and the least forked repositories, watched repositories. And the total number of forks for all repo's. Also you can work with the data provided about the amount of commits or contributers. - Add a readme to your repo explaining what your app does and how to use your app. Here's a [template](https://gist.github.com/jxson/1784669) and here you can see how to make [your readme awesome](https://gist.github.com/rrgayhart/91bba7bb39ea60136e5c). -### Step 5: **Some freeCodeCamp challenges:** +## Step 4: **Some freeCodeCamp challenges:** 1. [Comparisons with the Logical And Operator](https://www.freecodecamp.com/challenges/comparisons-with-the-logical-and-operator) @@ -29,7 +25,7 @@ Give feedback on the SPA (Github API) and git branching homework of one of you f 3. [Iterate over Arrays with map](https://www.freecodecamp.com/challenges/iterate-over-arrays-with-map) -## Step 6: More map, filter, reduce, and => +## Step 5: More map, filter, reduce, and => 1. Say you would like to write a program that doubles the odd numbers in an array and throws away the even number. @@ -110,17 +106,19 @@ let tasks = [monday, tuesday]; 3. Write a program that does the following: -- Collect two days' worth of tasks. -- Convert the task durations to hours, instead of minutes. -- Filter out everything that took two hours or more. -- Sum it all up. -- Multiply the result by a per-hour rate for billing (you can decide yourself what Maartje should make per hour). -- Output a formatted Euro amount. -- Don't forget to use `=>` + 1. Collect two days' worth of tasks. + 2. Convert the task durations to hours, instead of minutes. + 3. Filter out everything that took two hours or more. + 4. Sum it all up. + 5. Multiply the result by a per-hour rate for billing (you can decide yourself what Maartje should make per hour). + 6. Output a formatted Euro amount. + 7. Don't forget to use `=>` + +## _BONUS_ : Code Kata Race -_BONUS_ : Code Kata Race +Join Code Wars: https://www.codewars.com -If you haven't already join our clan: "Hack Your Future" in codewars +If you haven't already join our clan: "Social Hackers Academy" in codewars Solve the following problems: - [Problem 1](https://www.codewars.com/kata/keep-up-the-hoop) @@ -145,7 +143,7 @@ Remember the person with the most kata points gets a prize from Gijs (and you ca 1. [Stacks/Queues](https://www.youtube.com/watch?v=wjI1WNcIntg) (5 mins) 2. [JS Event Loops](https://www.youtube.com/watch?v=8aGhZQkoFbQ) (26 mins, watch this one twice or until you understand it) ->Create a new repository "hyf-javascript3". Also create a new folder "week1" inside this repository. +>Create a new repository "sha-javascript3". Also create a new folder "week1" inside this repository. Upload your homework files inside the week1 folder and write a description for this “commit”. -Your hyf-javascript3/week1 should now contain the files of your homework. +Your sha-javascript3/week1 should now contain the files of your homework. Place the link to your repository folder in Trello. diff --git a/Week7/REVIEW.md b/Week7/REVIEW.md index 5dac5c731..e7863726a 100644 --- a/Week7/REVIEW.md +++ b/Week7/REVIEW.md @@ -2,8 +2,7 @@ ``` This review covers: - • Git Workflow - • Map, + • Map • Reduce • Filter -``` \ No newline at end of file +``` diff --git a/Week8/MAKEME.md b/Week8/MAKEME.md index d72a0bb34..57259b77d 100644 --- a/Week8/MAKEME.md +++ b/Week8/MAKEME.md @@ -1,7 +1,7 @@ # Homework Week 8 This week you will work on finishing your application so it's actually useful!! ->[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week8/README.md) you find the readings you have to complete before the ninth lecture. +>[Here](https://github.com/SocialHackersCodeSchool/JavaScript/tree/master/Week8/README.md) you find the readings you have to complete before the ninth lecture. ## Step 1: Feedback step 4 and 6 week 7 @@ -24,11 +24,11 @@ So please: _BONUS_ : Code Kata Race -- [Codewars](https://www.codewars.com/collections/hyf-homework-number-2) +- [Codewars](https://www.codewars.com/collections/sha-homework-number-2) - If you need to refresh your memory on es6 classes: [es6-classes-in-depth](https://ponyfoo.com/articles/es6-classes-in-depth) - Also read this article on scopes & closures: [explaining-javascript-scope-and-closures](https://robertnyman.com/2008/10/09/explaining-javascript-scope-and-closures/) \ No newline at end of file +Your sha-javascript3/week2 should now contain all your homework files. +Place the link to your repository folder in Trello. --> diff --git a/Week9/README.md b/Week9/README.md index f06fb7955..d502e718e 100644 --- a/Week9/README.md +++ b/Week9/README.md @@ -5,13 +5,13 @@ Next week you will start with Node :balloon: ``` ### Refresher -- :star:Timir wrote a really nice javaScript REVIEW that explains which concepts are most important to know in JavaScript when you continue your coding journey to Node, this is a __MUST__ read: https://github.com/HackYourFuture/JavaScript/blob/master/Week9/MAKEME.md :star: +- :star:Timir wrote a really nice javaScript REVIEW that explains which concepts are most important to know in JavaScript when you continue your coding journey to Node, this is a __MUST__ read: https://github.com/SocialHackersCodeSchool/JavaScript/blob/master/Week9/MAKEME.md :star: - https://forum.freecodecamp.com/t/javascript-callback-functions/14658/2 http://www.learn-js.org/en/Callbacks ## Check out how to prepare for your first Node lecture here: -- https://github.com/HackYourFuture/Node.js/blob/master/week0/README.md +- https://github.com/SocialHackersCodeSchool/Node.js/blob/master/week0/README.md _Please go through the material and come to class prepared!_ diff --git a/teacher-prep/GUIDELINES.md b/teacher-prep/GUIDELINES.md new file mode 100644 index 000000000..15668a170 --- /dev/null +++ b/teacher-prep/GUIDELINES.md @@ -0,0 +1,36 @@ +Here are some guidelines on creating slides for your lesson presentations. + +• Most of the slides are based on the [Reveal.JS library](https://revealjs.com/#/). The library resides in `/teacher-prep/libs/revealjs` folder, so be sure to use the correct pathname (../libs/revealjs/) on your index.html file. For example: + + For the scripts: + + + For the CSS: + + +You can always take a look at the previous slides or just copy paste the index.html from one of the previous weeks and start working your way from there. + +• The slides are placed in the https://github.com/SocialHackersCodeSchool/JavaScript GitHub repository, using the Javascript 1, Javascript 2 naming convention for each week. + +• Be sure to include the following Reveal initialisation options on your presentation index.html file: + + `Reveal.initialize({ controls: true, progress: true, history: true, center: true, ...` + +• The slides must be uploaded on your GitHub repository and shared with the other teachers, 1~3 days before presentation, so that we have the time to review the slides and suggest changes or fix typos and other mistakes. + +• Try to avoid scrollable code content. Use only the minimum required code in order to explain the various concepts. + +• Add the `contenteditable` attribute on all snippets on the slides, in order for you to be able to edit it during the lesson. This is extremely helpful when you want to add or change the code on some slide, in order to explain something that came up during your discussion with the students. + +• Since we are trying to promote best coding practices to beginners, try to include semicolons; on all of your code snippets. + +• You can review (and comment or submit a PR) the slides created so far in the following URLs: + + https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Javascript 1/ + https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Javascript 2/ + https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Javascript 3/ + https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Javascript 4/ + https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Javascript 5/ + + + diff --git a/teacher-prep/QUIZ.pdf b/teacher-prep/QUIZ.pdf new file mode 100644 index 000000000..43126d77e Binary files /dev/null and b/teacher-prep/QUIZ.pdf differ diff --git a/teacher-prep/README.md b/teacher-prep/README.md new file mode 100644 index 000000000..71b66a9ad --- /dev/null +++ b/teacher-prep/README.md @@ -0,0 +1,13 @@ +## Teacher Presentations + +[Week 1](https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Week%201/) + +[Week 2](https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Week%202/) + +[Week 3](https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Week%203/) + +[Week 4](https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Week%204/) + +[Week 5](https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Week%205/) + +[Week 6](https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Week%206/) diff --git a/teacher-prep/Week 1/README.md b/teacher-prep/Week 1/README.md new file mode 100644 index 000000000..7db6b5f49 --- /dev/null +++ b/teacher-prep/Week 1/README.md @@ -0,0 +1,7 @@ +# Presentation Links + +https://drive.google.com/drive/folders/1EsrE1Z9SdG_VQenasIot83IPMqSThNmK + +# Week 1 + +https://socialhackerscodeschool.github.io/JavaScript/teacher-prep/Javascript%201/ diff --git a/teacher-prep/Week 1/images/DataTypeTalk-001.svg b/teacher-prep/Week 1/images/DataTypeTalk-001.svg new file mode 100644 index 000000000..d05605903 --- /dev/null +++ b/teacher-prep/Week 1/images/DataTypeTalk-001.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +“How much is for express mail?” + + + + + + + + + + + + + + \ No newline at end of file diff --git a/teacher-prep/Week 1/images/DataTypeTalk-002.svg b/teacher-prep/Week 1/images/DataTypeTalk-002.svg new file mode 100644 index 000000000..27f65a25d --- /dev/null +++ b/teacher-prep/Week 1/images/DataTypeTalk-002.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +“How much is for express mail?” + +99.99 + + + + + + + + + + + + \ No newline at end of file diff --git a/teacher-prep/Week 1/images/DataTypeTalk-003.svg b/teacher-prep/Week 1/images/DataTypeTalk-003.svg new file mode 100644 index 000000000..d221906a7 --- /dev/null +++ b/teacher-prep/Week 1/images/DataTypeTalk-003.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +“How much is for express mail?” +“Is standard mailcheaper?” +99.99 + + + + + + + + + + + + \ No newline at end of file diff --git a/teacher-prep/Week 1/images/DataTypeTalk-004.svg b/teacher-prep/Week 1/images/DataTypeTalk-004.svg new file mode 100644 index 000000000..e2352c638 --- /dev/null +++ b/teacher-prep/Week 1/images/DataTypeTalk-004.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +“How much is for express mail?” +“Is standard mailcheaper?” +99.99 + +Yes + + + + + + + + + + \ No newline at end of file diff --git a/teacher-prep/Week 1/images/DataTypeTalk-005.svg b/teacher-prep/Week 1/images/DataTypeTalk-005.svg new file mode 100644 index 000000000..06f89c984 --- /dev/null +++ b/teacher-prep/Week 1/images/DataTypeTalk-005.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +“How much is for express mail?” +“Is standard mailcheaper?” +99.99 + +Yes + +Characters +0123456789 +true | false“Strings” +Numbers + + + +Booleans + \ No newline at end of file diff --git a/teacher-prep/Week 1/images/M01W01S00.svg b/teacher-prep/Week 1/images/M01W01S00.svg new file mode 100644 index 000000000..416289076 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S00.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JAVASCRIPT MODULE 1: +Introduction to JavaScript + + diff --git a/teacher-prep/Week 1/images/M01W01S01.svg b/teacher-prep/Week 1/images/M01W01S01.svg new file mode 100644 index 000000000..2a9a6b026 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S01.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The World Wide Web (www) +HTML +CSS +JAVASCRIPT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript along with HTML and CSS forms a triad of cornerstone technologies for creating web pages and web applications. + diff --git a/teacher-prep/Week 1/images/M01W01S02.svg b/teacher-prep/Week 1/images/M01W01S02.svg new file mode 100644 index 000000000..f10b48961 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S02.svg @@ -0,0 +1,369 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1. HTML + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +HTML or HyperText Markup Language is the standard language for describing the structure of a web page using HTML elements (or tags) which are the building blocks of HTML pages. + +<element attribute=”value”> Content hoes here</element> +index.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S03.svg b/teacher-prep/Week 1/images/M01W01S03.svg new file mode 100644 index 000000000..3dc1921df --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S03.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +2. CSS + +CSS or Cascading Style Sheets is a style sheet language used for describing the presentation of a document written in HTML. It is designed pri-marily to enable the separation of presentation and content, including aspects such as the layout, colors, responsiveness, and fonts. + +selector { property: value;} #another .selector { property: value;} +index.html + style.css + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S04.svg b/teacher-prep/Week 1/images/M01W01S04.svg new file mode 100644 index 000000000..1a449dda6 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S04.svg @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +3. JavaScript + +JavaScript (JS) is a programming language used to make webpages interactive and provide online programs, including video games. All modern web browsers support JavaScript. + +console.log(true);if (click) showDialog();startTimer(); +index.html + style.css + script.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S05.svg b/teacher-prep/Week 1/images/M01W01S05.svg new file mode 100644 index 000000000..969143f2b --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S05.svg @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JavaScript + Interaction & Logic + + + CSS + + Presentation & Styling + + +HTML +Content & Structure +index.html +style.css +script.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S06.svg b/teacher-prep/Week 1/images/M01W01S06.svg new file mode 100644 index 000000000..c1559180f --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S06.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript +CSS +index.html +<html> <head> <link rel=”stylesheet” href=”style.css” /> <style> p { color: red; } </style> </head> <body> <p style=”color:red;”> Text </p> </body></html> + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S07.svg b/teacher-prep/Week 1/images/M01W01S07.svg new file mode 100644 index 000000000..546c233bb --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S07.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript +CSS +index.html +<html> <head> <link rel=”stylesheet” href=”style.css” /> <style> p { color: red; } </style> </head> <body> <p style=”color:red;”> Text </p> </body></html> + + + + + + + + + + + + + + + + + + External + + + 1 + + + diff --git a/teacher-prep/Week 1/images/M01W01S08.svg b/teacher-prep/Week 1/images/M01W01S08.svg new file mode 100644 index 000000000..cf74473be --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S08.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript +CSS +index.html +<html> <head> <link rel=”stylesheet” href=”style.css” /> <style> p { color: red; } </style> </head> <body> <p style=”color:red;”> Text </p> </body></html> + + + + + + + + + + + + + + + + + + Internal + + + 2 + + + diff --git a/teacher-prep/Week 1/images/M01W01S09.svg b/teacher-prep/Week 1/images/M01W01S09.svg new file mode 100644 index 000000000..5611bbeed --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S09.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript +CSS +index.html +<html> <head> <link rel=”stylesheet” href=”style.css” /> <style> p { color: red; } </style> </head> <body> <p style=”color:red;”> Text </p> </body></html> + + + + + + + + + + + + + + + + + + Inline + + + 3 + + + diff --git a/teacher-prep/Week 1/images/M01W01S10.svg b/teacher-prep/Week 1/images/M01W01S10.svg new file mode 100644 index 000000000..b1e94cc75 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S10.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript +CSS +index.html +<html> <head> <script src=”script.js”></script> <script> alert(’Hello’); </script> </head> <body> <p onclick=”alert(’Hello’);”> Text </p> </body></html> + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S11.svg b/teacher-prep/Week 1/images/M01W01S11.svg new file mode 100644 index 000000000..300a9a8dc --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S11.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript +CSS +index.html +<html> <head> <script src=”script.js”></script> <script> alert(’Hello’); </script> </head> <body> <p onclick=”alert(’Hello’);”> Text </p> </body></html> + + + + + + + + + + + + + + + + + + External + + + 1 + + + diff --git a/teacher-prep/Week 1/images/M01W01S12.svg b/teacher-prep/Week 1/images/M01W01S12.svg new file mode 100644 index 000000000..33e08daee --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S12.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript +CSS +index.html + + + + + + + + + + + + + + + + + + Internal + + + 2 + + +<html> <head> <script src=”script.js”></script> <script> alert(’Hello’); </script> </head> <body> <p onclick=”alert(’Hello’);”> Text </p> </body></html> + diff --git a/teacher-prep/Week 1/images/M01W01S13.svg b/teacher-prep/Week 1/images/M01W01S13.svg new file mode 100644 index 000000000..f3b5cf0c4 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S13.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript +CSS +index.html + + + + + + + + + + + + + + + + +<html> <head> <script src=”script.js”></script> <script> alert(’Hello’); </script> </head> <body> <p onclick=”alert(’Hello’);”> Text </p> </body></html> + + Inline + + + 3 + + + diff --git a/teacher-prep/Week 1/images/M01W01S14.svg b/teacher-prep/Week 1/images/M01W01S14.svg new file mode 100644 index 000000000..116f1a9dd --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S14.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +JavaScript +CSS +index.html + + + + + + + + + + + + + + + + +<html> <head> </head> <body> <p onclick=”alert(’Hello’);”> Text </p> ... HTML CONTENT ... <script src=”script.js”></script> <script> alert(’Hello’); </script> </body></html> +Best practice tip: place <script>just before the closing </body> tag. + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S15.svg b/teacher-prep/Week 1/images/M01W01S15.svg new file mode 100644 index 000000000..2e14705ee --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S15.svg @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +A Basic understanding of the JavaScript Interpreter + +You can think of the JavaScript interpreter, as a robot that lives inside the browser. It accepts a series of statements, interprets them and executes them one by one. + + + + + + + +statements +actions + + + + diff --git a/teacher-prep/Week 1/images/M01W01S16.svg b/teacher-prep/Week 1/images/M01W01S16.svg new file mode 100644 index 000000000..a76fc4215 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S16.svg @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +A Basic understanding of the JavaScript Interpreter + +For example, we can write a series of statements, instruct-ing JavaScript to display a modal window whenever the user clicks on a specific button on the page. + + + + + + + +<script> if ( button.click ){ openModalWindow(); }</script> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S17.svg b/teacher-prep/Week 1/images/M01W01S17.svg new file mode 100644 index 000000000..b90f9be62 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S17.svg @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +A Basic understanding of the JavaScript Interpreter + +For example, we can write a series of statements, instruct-ing JavaScript to display a modal window whenever the user clicks on a specific button on the page. + + + + + + + +<script> if ( button.click ){ openModalWindow(); }</script> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S18.svg b/teacher-prep/Week 1/images/M01W01S18.svg new file mode 100644 index 000000000..bd66f97dc --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S18.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +A Basic understanding of the JavaScript Interpreter + +The JavaScript interpreter running inside the browser deals mainly with two kinds of operations: + +• Input / Output• Data Manipulation (or Processing) + diff --git a/teacher-prep/Week 1/images/M01W01S19.svg b/teacher-prep/Week 1/images/M01W01S19.svg new file mode 100644 index 000000000..919a51ada --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S19.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +A Basic understanding of the JavaScript Interpreter + +Dealing with Input means that the interpreter has to deal with user input such mouse clicks, entering text into input forms or even speech. + +• Input / Output• Data Manipulation (or Processing) + + + + + + + + + Be + lgium + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S20.svg b/teacher-prep/Week 1/images/M01W01S20.svg new file mode 100644 index 000000000..f649351d4 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S20.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +A Basic understanding of the JavaScript Interpreter + +Data manipulation and processing means that JavaScript can read and act on data such as: numbers, user text, the contents of a file or a web page, image data, etc. + +• Input / Output• Data Manipulation & Processing +dv-interaction-auto-complete + diff --git a/teacher-prep/Week 1/images/M01W01S21.svg b/teacher-prep/Week 1/images/M01W01S21.svg new file mode 100644 index 000000000..def7cf1a8 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S21.svg @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Examples of Data Manipulation and Processing + + + + + + + + + + + + + + + + + + “BELGIUM”42 + +“Belgium”.toUpperCase()35 + 7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S22.svg b/teacher-prep/Week 1/images/M01W01S22.svg new file mode 100644 index 000000000..6ad240451 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S22.svg @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +A Basic understanding of the JavaScript Interpreter + +In regard to output, JavaScript can modify HTML ele-ments, dynamically create new ones and place them on the web page, modify the CSS, create graphics, manipu-late images, play sounds, etc. + +Input / Output• Data Manipulation (or Processing) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S23.svg b/teacher-prep/Week 1/images/M01W01S23.svg new file mode 100644 index 000000000..6c42be73f --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S23.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Our first JavaScript statement! + +Statements, are code instructions terminated by a semi-colon; They are executed one by one, in the same order as they are written: The main ingredients of statements are: Values, Operators, Keywords, Expressions and Comments. +1. doThisFirst();2. thenThis();3. andThis();4. lastlyDoThis(); + + diff --git a/teacher-prep/Week 1/images/M01W01S24.svg b/teacher-prep/Week 1/images/M01W01S24.svg new file mode 100644 index 000000000..5c7827157 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S24.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Our first JavaScript statement! + +In order to test our very first statement, we will use the browser’s console which can evaluate live JavaScript code. + + + + +To open the browser’s console, press:Ctrl + Shift + J (Windows) ChromeCmd + Option + J (Mac) Chrome + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S25.svg b/teacher-prep/Week 1/images/M01W01S25.svg new file mode 100644 index 000000000..5bb64aedf --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S25.svg @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Our first JavaScript statement! + +Once you’ve opened the browser console, type in the fol-lowing statements, terminated by a semicolon; + + + + + + + + + + + + + + + + + + + + + + +> 2018 - 1995; + + 1995 was the year that Brendan Eich invented JavaScript! + + + ! + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S26.svg b/teacher-prep/Week 1/images/M01W01S26.svg new file mode 100644 index 000000000..c695ca423 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S26.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +This is a basic math operation. (Remember Data Processing?)2018 and 1995 are JavaScript Values (Data) of type: Number.The minus sign ( - ) is an Operator that acts on values (or oper-ands) and produces a result. + + + + + + + + + + + + + + + + + + +> 2018 - 1995;> 23> typeof 2018;> “number” + + + + + + Use the typeof Operator to get the type of a value. + + + ! + + + diff --git a/teacher-prep/Week 1/images/M01W01S27.svg b/teacher-prep/Week 1/images/M01W01S27.svg new file mode 100644 index 000000000..276c1adba --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S27.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Arithmetic Operators include:+ Addition- Subtraction* Multiplication/ Division** Exponentiation % Remainder + + + + + + + + + + + + + + + + + + +> 1995 + 23;> 2018> 100 * 1.22;> 122> 122 / 100;> 1.22> 2 ** 3> 8> 10 + 5; 20 * 2; + + + + +JavaScript also supports decimals (floating point numbers). + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S28.svg b/teacher-prep/Week 1/images/M01W01S28.svg new file mode 100644 index 000000000..7bd46ef59 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S28.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +What if we wanted more than one operation per statement? + + + + + + + + + + + + + + + + + + +> 2018 - 1995 * 12;> -21932 + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S29.svg b/teacher-prep/Week 1/images/M01W01S29.svg new file mode 100644 index 000000000..a69be96b1 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S29.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +We need to take Operator Precedence in consideration: • Multiplication • Division • Remainder • Addition • Subtraction + + + + + + + + + + + + + + + + + + +> ( 2018 - 1995 ) * 12;> 156> ( 20 - 10 ) * ( 30 / 2 ) / 20 - 10> -2.5> ( 20 - 10 ) * ( 30 / 2 ) / ( 20 - 10)> 15 + + + + + diff --git a/teacher-prep/Week 1/images/M01W01S30.svg b/teacher-prep/Week 1/images/M01W01S30.svg new file mode 100644 index 000000000..574e87fc9 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S30.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Apart from Number values we can also enter String values. All text in JavaScript are of type String and are always enclosed inside “double” or ‘single’ quotes. We can also use the ( + ) operator on Strings, which concat-enates two or more of them into one String. + + + + + + + + + + + + + + + + + + +> “Text”;> “Some big text. Spaces included :)”;> ‘Single quotes work also’;> ‘My name is’ + ‘ Tim’;> “One, ” + “Two, ” + “Three.”; + + + + +Try: the typeof Operator on a text string. + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S31.svg b/teacher-prep/Week 1/images/M01W01S31.svg new file mode 100644 index 000000000..7fc4f49c6 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S31.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +It’s time to test our skills:CodePen.io time! +https://codepen.io/kostasx/pen/opVQQg +JavaScript uses two basic functions to output values to thebrowser: alert(VALUE); console.log(VALUE); + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S32.svg b/teacher-prep/Week 1/images/M01W01S32.svg new file mode 100644 index 000000000..b764e34e9 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S32.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Type Coercion: JavaScript tries to automatically convert the Type of some Values in order to perform an operation using the same Data Type. + + + + + + + + + + + + + + + + + + +> “JavaScript is ” + 2018 - 1995 + “ years old”;> "NaN years old." + +1) “JavaScript is ” + 20182) “JavaScript is 2018” - 19953) NaN + “ years old”4) “NaN years old” +NaN is a special JS value indicating a Not-A-Number. Fun fact: typeof Nan is “number”! + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S33.svg b/teacher-prep/Week 1/images/M01W01S33.svg new file mode 100644 index 000000000..88ce7c87c --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S33.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Storing values using Variables + +Values can be stored in memory and accessed at any point during the execution of our program using Vari-ables.We use the let and const keywords to declare a variable’s name and the assignment ( = ) Operator to assign a value + +Values stored in Variables can be accessed, just by call-ing their names: +let someName = “Name”;let someDate;someDate; = 2018;const dateOfBirth = 1995; +someName; Returns: “Name”someDate; Returns: 2018dateOfBirth; Returns: 1995 + diff --git a/teacher-prep/Week 1/images/M01W01S34.svg b/teacher-prep/Week 1/images/M01W01S34.svg new file mode 100644 index 000000000..8fe3f8f8f --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S34.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Storing values using Variables + +The values of Variables declared with the let keyword can be changed (re-assigned) at any point in the program. The value of variables declared with the const keyword is as-signed once during its declaration, and cannot be changed. +let someName = “Name”;let someDate = 2018;const dateOfBirth = 1995;someName = “Other Name”;dateOfBirth = 2018;Uncaught TypeError: Assignment to constant variable +Before ES6 all variables were declared with the var keyword. + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S35.svg b/teacher-prep/Week 1/images/M01W01S35.svg new file mode 100644 index 000000000..7c668972a --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S35.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +It’s time to test our skills:CodePen.io time! +https://codepen.io/kostasx/pen/QaoRZN + diff --git a/teacher-prep/Week 1/images/M01W01S36.svg b/teacher-prep/Week 1/images/M01W01S36.svg new file mode 100644 index 000000000..4acbf5adc --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S36.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Meet the Booleans + +Values of type Boolean, can be either true or false. + +Booleans can also be the result of Comparison Operators such as === which is used to compare two values: +let someBoolean = true;const anotherName = false;console.log( typeof someBoolean ); “boolean” +console.log( “text” === “text” ); true console.log( 34 === 45 ); false +The opposite of === is the !== operator which checks if twovalues are not the same. + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S37.svg b/teacher-prep/Week 1/images/M01W01S37.svg new file mode 100644 index 000000000..c89702fef --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S37.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Arrays: lists of Values + +Arrays are Values grouped together in lists. They can contain all kinds of Data Types, such as Strings, Numbers, Booleans, including other Arrays. +const numberList = [ 0, 1, 2, 3 ]; let listOfNames = [ ‘Abdul’, ‘Kostas’, ‘Chris’ ];let mixedData = [ ‘Athens’, 2018, false, [ 1,2,3 ] ]; +The typeof an Array is ‘object’! + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S38.svg b/teacher-prep/Week 1/images/M01W01S38.svg new file mode 100644 index 000000000..f96f1319f --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S38.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Arrays: Accessing Values + +You can access any Array element using the variable’s name followed by the index number within [ brackets ]: + 0 1 2listOfNames[0]; ‘Abdul’ [Abdul,‘Kostas’,‘Chris’]listOfNames[1]; ‘Kostas’ [‘Abdul’,‘Kostas’,‘Chris’]listOfNames[2]; ‘Chris’ [‘Abdul’,‘Kostas’,‘Chris’]listOfNames[3]; undefined +Index count always starts from 0 + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S39.svg b/teacher-prep/Week 1/images/M01W01S39.svg new file mode 100644 index 000000000..17a74e48f --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S39.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Arrays: Adding & Removing Values + +You can add and remove values from an Array using the following methods: + +You can always check the number of elements in an Array using the length property: +let numberList = [ 1, 2, 3 ];numberList.push(4); [ 1, 2, 3, 4 ]numberList.pop(); [ 1, 2, 3 _ ]numberList.unshift(0); [ 0, 1, 2, 3 ]numberList.shift(); [ _ 1, 2, 3 ] +console.log( numberList.length ); + diff --git a/teacher-prep/Week 1/images/M01W01S40.svg b/teacher-prep/Week 1/images/M01W01S40.svg new file mode 100644 index 000000000..1485ca8af --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S40.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +It’s time to test our skills:CodePen.io time! +https://codepen.io/kostasx/pen/ppBGGb + diff --git a/teacher-prep/Week 1/images/M01W01S41.svg b/teacher-prep/Week 1/images/M01W01S41.svg new file mode 100644 index 000000000..ad70a196c --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S41.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +More on Values: Null & Undefined + +Undefined is the value that gets returned when we try to access a variable with no assigned value: + +Null is a special object that can be assigned to a variable and indicates the absence of a value. +let numberList;console.log( numberList ); “undefined” +let emptyness = null;console.log( emptyness ); nullconsole.log( typeof emptyness ); “object” +undefined is returned when we try to get the typeofan undeclared variable: typeof nonExistentVar + + + ! + + diff --git a/teacher-prep/Week 1/images/M01W01S42.svg b/teacher-prep/Week 1/images/M01W01S42.svg new file mode 100644 index 000000000..e854cc848 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S42.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Comparison Operators + +== Checks whether two operands are equal!= Checks whether two operands are not equal(Both of these operators, automatically convert the two operands to the same data type) + +=== Checks whether two operands are equal and of the same type!== Checks whether two operands are of the same type and not equal or they are not of the same type +4 == 5; false4 == 4; true4 == “4”; true”text” == “text”; true”text” != “other”; true +4 === 4; true4 === “4”; false365 !== “text” true + diff --git a/teacher-prep/Week 1/images/M01W01S43.svg b/teacher-prep/Week 1/images/M01W01S43.svg new file mode 100644 index 000000000..694cb6352 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S43.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Comparison Operators + +> Checks whether the left operand is greater than the right one>= Checks whether the left operand is greater than or equal to the right one< Checks whether the left operand is less than the right one<= Checks whether the left operand is less than or equal to the right one +4 > 5; false4 >= 4; true4 >= “4”; true4 < 5; true2 >= 2; true + diff --git a/teacher-prep/Week 1/images/M01W01S44.svg b/teacher-prep/Week 1/images/M01W01S44.svg new file mode 100644 index 000000000..fb3a841a8 --- /dev/null +++ b/teacher-prep/Week 1/images/M01W01S44.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Logical Operators + +Logical OR || checks whether one of the two oper-ands returns true once they have been evaluated: + +Logical AND && checks whether both operands re-turns true once they have been evaluated: +( 5 > 4 ) || ( 4 > 3 ); true( 5 > 4 ) || ( 4 < 3 ); true”text” === “diff” || 4 == 3; false +( 5 > 4 ) && ( 4 > 3 ); true( 5 > 4 ) && ( 4 < 3 ); false”text” === “diff” && 4 == 3; false + diff --git a/teacher-prep/Week 1/index-svg--deprecated.html b/teacher-prep/Week 1/index-svg--deprecated.html new file mode 100644 index 000000000..f5cdf73ca --- /dev/null +++ b/teacher-prep/Week 1/index-svg--deprecated.html @@ -0,0 +1,151 @@ + + + + + SHA | Module 01 Week 01 + + + + + +
      + 1 + + + +
      + + + + diff --git a/teacher-prep/Week 1/index.html b/teacher-prep/Week 1/index.html new file mode 100644 index 000000000..4683d83a1 --- /dev/null +++ b/teacher-prep/Week 1/index.html @@ -0,0 +1,399 @@ + + + + + + + SHA | Module 01 Week 01 + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + + + + +
      +

      JavaScript | An Introduction

      +

      Module 01 | Week 01

      +

      + By Kosmas Pouianou and Kostas Minaidis +

      +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      +
      + +
      + +
      +

      Primitive Data Types

      +
      A real life comparison...
      +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      +
      +
      +
      + +
      + LINK +
      +
      +
      +
      +
      + LINK +
      +
      +
      +
      +
      +
      + LINK +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + More on Values: Null & Undefined + + Undefined is the value that gets returned when we try to access a variable with no assigned value: + + Null is a special object that can be assigned to a variable and indicates the absence of a value. + let numberList;console.log( numberList ); “undefined” + let emptyness = null;console.log( emptyness ); nullconsole.log( typeof emptyness ); “object” + undefined is returned when we try to get the typeofan undeclared variable: typeof nonExistentVar + + + ! + + +
      + + +
      + + Comparison Operators==Checks whether two operands are equal!=Checks whether two operands are not equal(Both of these operators, automatically convert the two operands to the same data type)===Checks whether two operands are equal and of the same type!==Checks whether two operands are of the same type and not equal or they are not of the same type4 == 5;false4 == 4;true4 == “4”;true”text” == “text”;true”text” != “other”;true4 === 4;true4 === “4”;false365 !== “text”true + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Comparison Operators + + > Checks whether the left operand is greater than the right one>= Checks whether the left operand is greater than or equal to the right one< Checks whether the left operand is less than the right one<= Checks whether the left operand is less than or equal to the right one + 4 > 5; false4 >= 4; true4 >= “4”; true4 < 5; true2 >= 2; true + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Logical Operators + + Logical OR || checks whether one of the two oper-ands returns true once they have been evaluated: + + Logical AND && checks whether both operands re-turns true once they have been evaluated: + ( 5 > 4 ) || ( 4 > 3 ); true( 5 > 4 ) || ( 4 < 3 ); true”text” === “diff” || 4 == 3; false + ( 5 > 4 ) && ( 4 > 3 ); true( 5 > 4 ) && ( 4 < 3 ); false”text” === “diff” && 4 == 3; false + + + +
      + +
      + +
      + + + + + + + + diff --git a/teacher-prep/Week 2/README.md b/teacher-prep/Week 2/README.md new file mode 100644 index 000000000..d45f90567 --- /dev/null +++ b/teacher-prep/Week 2/README.md @@ -0,0 +1,9 @@ +# Teacher Preparation Directory + +In here, you will find any planning that teachers who have delivered this course have done. This may be in the form of: + +* Presentations +* Exercises +* Useful Links +* Past Experiences +* Live Coding Exercises diff --git a/teacher-prep/Week 2/W02a/images/understanding_functions_01.jpg b/teacher-prep/Week 2/W02a/images/understanding_functions_01.jpg new file mode 100644 index 000000000..7b63d361d Binary files /dev/null and b/teacher-prep/Week 2/W02a/images/understanding_functions_01.jpg differ diff --git a/teacher-prep/Week 2/W02a/images/understanding_functions_02.jpg b/teacher-prep/Week 2/W02a/images/understanding_functions_02.jpg new file mode 100644 index 000000000..f54b3d91a Binary files /dev/null and b/teacher-prep/Week 2/W02a/images/understanding_functions_02.jpg differ diff --git a/teacher-prep/Week 2/W02a/images/understanding_functions_03.jpg b/teacher-prep/Week 2/W02a/images/understanding_functions_03.jpg new file mode 100644 index 000000000..7d534f17b Binary files /dev/null and b/teacher-prep/Week 2/W02a/images/understanding_functions_03.jpg differ diff --git a/teacher-prep/Week 2/W02a/images/understanding_functions_04.jpg b/teacher-prep/Week 2/W02a/images/understanding_functions_04.jpg new file mode 100644 index 000000000..cc652969f Binary files /dev/null and b/teacher-prep/Week 2/W02a/images/understanding_functions_04.jpg differ diff --git a/teacher-prep/Week 2/W02a/images/understanding_functions_05.jpg b/teacher-prep/Week 2/W02a/images/understanding_functions_05.jpg new file mode 100644 index 000000000..1e4ecbdb0 Binary files /dev/null and b/teacher-prep/Week 2/W02a/images/understanding_functions_05.jpg differ diff --git a/teacher-prep/Week 2/W02a/images/understanding_functions_06.jpg b/teacher-prep/Week 2/W02a/images/understanding_functions_06.jpg new file mode 100644 index 000000000..0e5ce7d37 Binary files /dev/null and b/teacher-prep/Week 2/W02a/images/understanding_functions_06.jpg differ diff --git a/teacher-prep/Week 2/W02a/index.html b/teacher-prep/Week 2/W02a/index.html new file mode 100644 index 000000000..37ff3dfcb --- /dev/null +++ b/teacher-prep/Week 2/W02a/index.html @@ -0,0 +1,879 @@ + + + + + + + JavaScript Module 1 | Week 02 Part I | Social Hackers Academy + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + +
      +

      JavaScript

      +

      Module 01 | Week 02a

      +

      + By Kosmas Pouianou and Kostas Minaidis +

      +
      + +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      + + +
      +

      Part I | Recapping

      +
        +
      • Recap Logical operators
      • +
      • Typeof
      • +
      • Loops (for/while)
      • +
      • Functions
      • +
      • Objects [Advanced data types]
      • +
      • Conditions
      • +
      • Statements vs Expressions
      • +
      • Naming conventions
      • +
      +
      + + +
      + +
      +

      Expressions & Statements

      +

      Quick Intro

      +
      + +
      +

      What are EXPRESSIONS?

      + A piece of code that produces a value: +
      +							4 + 5
      +						
      + This piece of code produces a value of 9 +
      +							x = 6
      +						
      + Evaluates to 6 + +
      +							"Some Text String"
      +						
      + Evalutes to "Some Text String" + +

      More on Expressions

      + +
      + +
      + +

      What are STATEMENTS?

      +

      Can be thought of as commands/instructions.

      +

      They can contain EXPRESSIONS.

      +

      They end with a semicolon ;

      + +
      +							
      +							let bucket = 4 + 5; 
      +							
      +						
      + +

      More on Statements

      + +
      + +
      + + +
      +
      +

      The while ... loop

      +

      (Recap)

      +
      +
      +
      +							
      +							while ( EXPRESSION ){
      +
      +								RUN CODE...
      +
      +							}
      +							
      +						
      +

      While some EXPRESSION evaluates to TRUE run the { code }

      +
      +
      +
      Example:
      +
      +							
      +							let counter = 0;
      +
      +							while ( counter < 3 ){
      +
      +								console.log( “Counter value is: “ + counter );
      +								counter = counter + 1;
      +
      +							}
      +							
      +						
      +

      + Output:

      +

      +
      +							
      +							Counter value is: 0
      +							
      +						
      +
      +							
      +							Counter value is: 1
      +							
      +						
      +
      +							
      +							Counter value is: 2
      +							
      +						
      + +
      +
      + + +
      +
      +

      The for ... loop

      +
      A while statement with... a twist!
      +

      (Recap)

      +
      +
      +
      +							
      +							let counter = 0; 
      +							while ( counter < 3 ){
      +
      +								console.log( counter );
      +								counter = counter + 1;
      +
      +							}
      +							
      +						
      +
      +							
      +							for ( let counter = 0; counter < 3; counter = counter + 1 ){
      +
      +								console.log( counter );
      +
      +							}
      +							
      +						
      +

      So, the loop structure is this:

      +
      +							
      +							for ( START STATEMENT; CONDITION; END STATEMENT ){
      +
      +								CODE
      +
      +							}
      +							
      +						
      + + +
      +
      +
      Example:
      +
      +							
      +							let someArray = [ "a", "b", "c" ];
      +
      +							for ( let counter = 0; counter < someArray.length; counter++ ){
      +
      +							  console.log( "Counter value is: " + someArray[counter] );
      +
      +							}
      +							
      +						
      +

      + Output:

      +

      +
      +							
      +							Counter value is: a
      +							
      +						
      +
      +							
      +							Counter value is: b
      +							
      +						
      +
      +							
      +							Counter value is: c
      +							
      +						
      + +
      +
      + + +
      +
      +

      Functions

      +

      (Recap)

      +
      +
      +

      Declaring a Function:

      +
      +							
      +							function repeatCode( param, otherParam ){
      +
      +								console.log( param );
      +								console.log( otherParam );
      +
      +							}
      +							
      +						
      +

      Calling the Function:

      +
      +							
      +							repeatCode( "value for param", "value for otherParam" );
      +							
      +						
      + +

      Will output:

      +
      +							
      +							"value for param"
      +							"value for otherParam"
      +							
      +						
      + +
      +
      +

      Declaring a Function (#2):

      +
      +							
      +							function repeatCode( param, otherParam ){
      +
      +								console.log( param );
      +								console.log( otherParam );
      +
      +							}
      +							
      +						
      +

      Can be declared as:

      +
      +							
      +							let repeatCode = function( param, otherParam ){
      +
      +								console.log( param );
      +								console.log( otherParam );
      +
      +							}
      +
      +							
      +						
      + + +
      +
      + + +
      +
      +

      Understanding Scope

      +

      let, const, var

      +
      +
      +

      Declaring a Function:

      +
      +							
      +							function repeatCode( param, otherParam ){
      +
      +								console.log( param );
      +								console.log( otherParam );
      +
      +							}
      +							
      +						
      +

      Calling the Function:

      +
      +							
      +							repeatCode( "value for param", "value for otherParam" );
      +							
      +						
      + +

      Will output:

      +
      +							
      +							"value for param"
      +							"value for otherParam"
      +							
      +						
      + +
      +
      +

      Declaring a Function (#2):

      +
      +							
      +							function repeatCode( param, otherParam ){
      +
      +								console.log( param );
      +								console.log( otherParam );
      +
      +							}
      +							
      +						
      +

      Can be declared as:

      +
      +							
      +							let repeatCode = function( param, otherParam ){
      +
      +								console.log( param );
      +								console.log( otherParam );
      +
      +							}
      +
      +							
      +						
      + + +
      +
      + + +
      +
      +

      The typeof operator

      +

      (Recap)

      +
      +
      +
      +							
      +							typeof "Some Text";	//=> 'string'
      +							typeof 1234;		//=> 'number'
      +							typeof true;		//=> 'boolean'
      +							
      +						
      +
      +
      + + +
      +

      Part II

      +
        +
      • Recap Logical operators
      • +
      • Typeof
      • +
      • Loops (for/while)
      • +
      • Functions
      • +
      • Objects [Advanced data types]
      • +
      • Conditions
      • +
      • Statements vs Expressions
      • +
      • Naming conventions
      • +
      +
      + + +
      +
      +

      CONDITIONAL STATEMENTS

      +

      if ... else

      +
      +
      +

      if { ... }

      +
      +							
      +							let trafficLight = 'red';
      +
      +							if ( trafficLight === 'red' ){
      +
      +
      +							  console.log( "Stop the car!" );
      +
      +
      +							}
      +							
      +						
      + +
      +
      +

      if { ... } else { ... }

      +
      +							
      +							let trafficLight = 'red';
      +
      +							if ( trafficLight === 'red' ){
      +
      +
      +								console.log( "Stop the car!" );
      +
      +
      +							} else {
      +
      +								console.log( "Move on." );
      +
      +							}
      +							
      +						
      + +
      + +
      +

      NESTED if { ... } else { ... }

      +
      +							
      +							let trafficLight = 'red';
      +
      +							if ( trafficLight === 'red' ){
      +							  console.log( "Stop the car!" );
      +							} else {
      +							  if ( trafficLight === "orange" ){
      +							    console.log( "Slow down!" );
      +							  } else {
      +							    if ( trafficLight === "green" ){
      +							      console.log( "Move on." );
      +							    }
      +							  }
      +							}
      +							
      +						
      +

      This can be written like this...

      + +
      + +
      +

      if { ... } else if { ... }

      +
      +							
      +							if ( trafficLight === 'red' ){
      +
      +							  console.log( "Stop the car!" );
      +
      +							} else if ( trafficLight === "orange" ){
      +
      +							    console.log( "Slow down!" );
      +
      +							} else if ( trafficLight === "green" ){
      +
      +							      console.log( "Move on." );
      +
      +							}
      +							
      +						
      +
      + +
      + + +
      +

      The switch statement

      +

      No more else if's!

      +
      +							
      +							let trafficLight = "orange";
      +
      +							switch (trafficLight){
      +
      +							    case "red":
      +								  console.log("Stop!");
      +								  break;
      +							    case "orange":
      +								  console.log("Slow down");
      +								  break;
      +							    case "green":
      +								  console.log("Move on");
      +								  break;
      +							}
      +							
      +						
      +

      More on the Switch Statement

      + +
      + + +
      +

      LET'S CODE!

      + http://bit.ly/2siSKqw +
      + + +
      +
      +

      Objects

      +
      { Advanced Data Structures }
      +
      +
      +
      Remember Arrays?
      +
      +							
      +							let arr = [ "Kosmas", "Kostas", "Chris" ]; 
      +							console.log( arr[0] );
      +							
      +						
      +

      Under the hood, this works much like this:

      +
      +							
      +								[ 0: "Kosmas", 1: "Kostas", 2: "Chris" ]
      +							
      +						
      +
      +
      +

      Declaring an Object:

      +
      +							
      +							let obj = { teacher: "Kosmas", assistant: "Kostas", founder: "Chris" }
      +							
      +						
      +

      In Objects, instead of using a numeric index for each element,
      we explicitly define a key (String).

      +
      +
      +

      Accessing an Object Property:

      +
      
      +						let obj = { teacher: "Kosmas", assistant: "Kostas", founder: "Chris" }
      +
      +						console.log( obj["teacher"] );
      +						console.log( obj.assistant );
      +						
      +

      Will Output:

      +
      
      +							"Kosmas"
      +							"Kostas"
      +						
      +
      +
      +

      Setting an Object Property:

      +
      
      +						let obj = { teacher: "Kosmas", assistant: "Kostas", founder: "Chris" }
      +
      +						obj.teacher = "Mary";
      +
      +						console.log( obj );
      +						console.log( obj["teacher"] );
      +						
      +

      Will Output:

      +
      { teacher: "Mary", assistant: "Kostas", founder: "Chris" }
      +							"Mary"
      +						
      +
      +
      +

      When an Object Property contains a Function, it is called a method

      +
      +							
      +							let car = {
      +							  color: "red",
      +							  year: 2010,
      +							  type: "sports",
      +							  showInfo: function(){
      +							    console.log("A red sports car.");
      +							  }
      +							}
      +							car.showInfo();
      +							
      +						
      +

      Will output:

      +
      
      +						"A red sports car."
      +						
      +
      +
      +

      You can access any Object property using the this keyword, while inside the Object.

      +
      +							
      +							let car = {
      +							  color: "red",
      +							  year: 2010,
      +							  type: "sports",
      +							  showInfo: function(){
      +							    console.log("A " + this.color + " sports car.");
      +							  }
      +							}
      +							car.showInfo();
      +							
      +						
      +

      Will output:

      +
      
      +						"A red sports car."
      +						
      +
      +
      + + +
      +

      LET'S CODE!

      + http://bit.ly/2E8Qxn4 +
      + + +
      +

      Naming Conventions

      +
        +
      • Variable names and object keys should be camel-cased
      • +
      • Variables should use nouns as names, and functions should use verbs
      • +
      • Variables with array values should use plural nouns, variables with object values should use singular nouns
      • +
      • Variable and function names should preferably be short but expressive
      • +
      +
      
      +					const some_number = 'apple'; // BAD
      +					const fruits = 'apple'; // BAD
      +					const color = ['red', 'orange']; // BAD
      +					const Xyz = 33; // BAD
      +
      +					const user = { // GOOD
      +					    preferredFruits: ['apple', 'orange'],
      +					    topFruit: 'apple'
      +					}
      +					
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + + + + + + diff --git a/teacher-prep/Week 2/W02b/README.md b/teacher-prep/Week 2/W02b/README.md new file mode 100644 index 000000000..f2ab6ca88 --- /dev/null +++ b/teacher-prep/Week 2/W02b/README.md @@ -0,0 +1,1246 @@ +# reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.svg?branch=master)](https://travis-ci.org/hakimel/reveal.js) Slides + +A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://revealjs.com/). + +reveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [Markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). There's also a fully featured visual editor and platform for sharing reveal.js presentations at [slides.com](https://slides.com?ref=github). + +## Table of contents +- [Online Editor](#online-editor) +- [Instructions](#instructions) + - [Markup](#markup) + - [Markdown](#markdown) + - [Element Attributes](#element-attributes) + - [Slide Attributes](#slide-attributes) +- [Configuration](#configuration) +- [Presentation Size](#presentation-size) +- [Dependencies](#dependencies) +- [Ready Event](#ready-event) +- [Auto-sliding](#auto-sliding) +- [Keyboard Bindings](#keyboard-bindings) +- [Touch Navigation](#touch-navigation) +- [Lazy Loading](#lazy-loading) +- [API](#api) + - [Slide Changed Event](#slide-changed-event) + - [Presentation State](#presentation-state) + - [Slide States](#slide-states) + - [Slide Backgrounds](#slide-backgrounds) + - [Parallax Background](#parallax-background) + - [Slide Transitions](#slide-transitions) + - [Internal links](#internal-links) + - [Fragments](#fragments) + - [Fragment events](#fragment-events) + - [Code syntax highlighting](#code-syntax-highlighting) + - [Slide number](#slide-number) + - [Overview mode](#overview-mode) + - [Fullscreen mode](#fullscreen-mode) + - [Embedded media](#embedded-media) + - [Stretching elements](#stretching-elements) + - [postMessage API](#postmessage-api) +- [PDF Export](#pdf-export) +- [Theming](#theming) +- [Speaker Notes](#speaker-notes) + - [Share and Print Speaker Notes](#share-and-print-speaker-notes) + - [Server Side Speaker Notes](#server-side-speaker-notes) +- [Multiplexing](#multiplexing) + - [Master presentation](#master-presentation) + - [Client presentation](#client-presentation) + - [Socket.io server](#socketio-server) +- [MathJax](#mathjax) +- [Installation](#installation) + - [Basic setup](#basic-setup) + - [Full setup](#full-setup) + - [Folder Structure](#folder-structure) +- [License](#license) + +#### More reading +- [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history. +- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own! +- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks. +- [Plugins](https://github.com/hakimel/reveal.js/wiki/Plugins,-Tools-and-Hardware): A list of plugins that can be used to extend reveal.js. + +## Online Editor + +Presentations are written using HTML or Markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [https://slides.com](https://slides.com?ref=github). + + +## Instructions + +### Markup + +Here's a barebones example of a fully working reveal.js presentation: +```html + + + + + + +
      +
      +
      Slide 1
      +
      Slide 2
      +
      +
      + + + + +``` + +The presentation markup hierarchy needs to be `.reveal > .slides > section` where the `section` represents one slide and can be repeated indefinitely. If you place multiple `section` elements inside of another `section` they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and will be included in the horizontal sequence. For example: + +```html +
      +
      +
      Single Horizontal Slide
      +
      +
      Vertical Slide 1
      +
      Vertical Slide 2
      +
      +
      +
      +``` + +### Markdown + +It's possible to write your slides using Markdown. To enable Markdown, add the `data-markdown` attribute to your `
      ` elements and wrap the contents in a ` +
      +``` + +#### External Markdown + +You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file: the `data-separator` attribute defines a regular expression for horizontal slides (defaults to `^\r?\n---\r?\n$`, a newline-bounded horizontal rule) and `data-separator-vertical` defines vertical slides (disabled by default). The `data-separator-notes` attribute is a regular expression for specifying the beginning of the current slide's speaker notes (defaults to `note:`). The `data-charset` attribute is optional and specifies which charset to use when loading the external file. + +When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup). The following example customises all available options: + +```html +
      + +
      +``` + +#### Element Attributes + +Special syntax (in html comment) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things. + +```html +
      + +
      +``` + +#### Slide Attributes + +Special syntax (in html comment) is available for adding attributes to the slide `
      ` elements generated by your Markdown. + +```html +
      + +
      +``` + +#### Configuring *marked* + +We use [marked](https://github.com/chjj/marked) to parse Markdown. To customise marked's rendering, you can pass in options when [configuring Reveal](#configuration): + +```javascript +Reveal.initialize({ + // Options which are passed into marked + // See https://github.com/chjj/marked#options-1 + markdown: { + smartypants: true + } +}); +``` + +### Configuration + +At the end of your page you need to initialize reveal by running the following code. Note that all config values are optional and will default as specified below. + +```javascript +Reveal.initialize({ + + // Display presentation control arrows + controls: true, + + // Help the user learn the controls by providing hints, for example by + // bouncing the down arrow when they first encounter a vertical slide + controlsTutorial: true, + + // Determines where controls appear, "edges" or "bottom-right" + controlsLayout: 'bottom-right', + + // Visibility rule for backwards navigation arrows; "faded", "hidden" + // or "visible" + controlsBackArrows: 'faded', + + // Display a presentation progress bar + progress: true, + + // Set default timing of 2 minutes per slide + defaultTiming: 120, + + // Display the page number of the current slide + slideNumber: false, + + // Push each slide change to the browser history + history: false, + + // Enable keyboard shortcuts for navigation + keyboard: true, + + // Enable the slide overview mode + overview: true, + + // Vertical centering of slides + center: true, + + // Enables touch navigation on devices with touch input + touch: true, + + // Loop the presentation + loop: false, + + // Change the presentation direction to be RTL + rtl: false, + + // Randomizes the order of slides each time the presentation loads + shuffle: false, + + // Turns fragments on and off globally + fragments: true, + + // Flags if the presentation is running in an embedded mode, + // i.e. contained within a limited portion of the screen + embedded: false, + + // Flags if we should show a help overlay when the questionmark + // key is pressed + help: true, + + // Flags if speaker notes should be visible to all viewers + showNotes: false, + + // Global override for autoplaying embedded media (video/audio/iframe) + // - null: Media will only autoplay if data-autoplay is present + // - true: All media will autoplay, regardless of individual setting + // - false: No media will autoplay, regardless of individual setting + autoPlayMedia: null, + + // Number of milliseconds between automatically proceeding to the + // next slide, disabled when set to 0, this value can be overwritten + // by using a data-autoslide attribute on your slides + autoSlide: 0, + + // Stop auto-sliding after user input + autoSlideStoppable: true, + + // Use this method for navigation when auto-sliding + autoSlideMethod: Reveal.navigateNext, + + // Enable slide navigation via mouse wheel + mouseWheel: false, + + // Hides the address bar on mobile devices + hideAddressBar: true, + + // Opens links in an iframe preview overlay + // Add `data-preview-link` and `data-preview-link="false"` to customise each link + // individually + previewLinks: false, + + // Transition style + transition: 'slide', // none/fade/slide/convex/concave/zoom + + // Transition speed + transitionSpeed: 'default', // default/fast/slow + + // Transition style for full page slide backgrounds + backgroundTransition: 'fade', // none/fade/slide/convex/concave/zoom + + // Number of slides away from the current that are visible + viewDistance: 3, + + // Parallax background image + parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'" + + // Parallax background size + parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" + + // Number of pixels to move the parallax background per slide + // - Calculated automatically unless specified + // - Set to 0 to disable movement along an axis + parallaxBackgroundHorizontal: null, + parallaxBackgroundVertical: null, + + // The display mode that will be used to show slides + display: 'block' + +}); +``` + + +The configuration can be updated after initialization using the ```configure``` method: + +```javascript +// Turn autoSlide off +Reveal.configure({ autoSlide: 0 }); + +// Start auto-sliding every 5s +Reveal.configure({ autoSlide: 5000 }); +``` + + +### Presentation Size + +All presentations have a normal size, that is the resolution at which they are authored. The framework will automatically scale presentations uniformly based on this size to ensure that everything fits on any given display or viewport. + +See below for a list of configuration options related to sizing, including default values: + +```javascript +Reveal.initialize({ + + ... + + // The "normal" size of the presentation, aspect ratio will be preserved + // when the presentation is scaled to fit different resolutions. Can be + // specified using percentage units. + width: 960, + height: 700, + + // Factor of the display size that should remain empty around the content + margin: 0.1, + + // Bounds for smallest/largest possible scale to apply to content + minScale: 0.2, + maxScale: 1.5 + +}); +``` + +If you wish to disable this behavior and do your own scaling (e.g. using media queries), try these settings: + +```javascript +Reveal.initialize({ + + ... + + width: "100%", + height: "100%", + margin: 0, + minScale: 1, + maxScale: 1 +}); +``` + +### Dependencies + +Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example: + +```javascript +Reveal.initialize({ + dependencies: [ + // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/ + { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, + + // Interpret Markdown in
      elements + { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + + // Syntax highlight for elements + { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, + + // Zoom in and out with Alt+click + { src: 'plugin/zoom-js/zoom.js', async: true }, + + // Speaker notes + { src: 'plugin/notes/notes.js', async: true }, + + // MathJax + { src: 'plugin/math/math.js', async: true } + ] +}); +``` + +You can add your own extensions using the same syntax. The following properties are available for each dependency object: +- **src**: Path to the script to load +- **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false +- **callback**: [optional] Function to execute when the script has loaded +- **condition**: [optional] Function which must return true for the script to be loaded + +To load these dependencies, reveal.js requires [head.js](http://headjs.com/) *(a script loading library)* to be loaded before reveal.js. + +### Ready Event + +A 'ready' event is fired when reveal.js has loaded all non-async dependencies and is ready to start navigating. To check if reveal.js is already 'ready' you can call `Reveal.isReady()`. + +```javascript +Reveal.addEventListener( 'ready', function( event ) { + // event.currentSlide, event.indexh, event.indexv +} ); +``` + +Note that we also add a `.ready` class to the `.reveal` element so that you can hook into this with CSS. + +### Auto-sliding + +Presentations can be configured to progress through slides automatically, without any user input. To enable this you will need to tell the framework how many milliseconds it should wait between slides: + +```javascript +// Slide every five seconds +Reveal.configure({ + autoSlide: 5000 +}); +``` +When this is turned on a control element will appear that enables users to pause and resume auto-sliding. Alternatively, sliding can be paused or resumed by pressing »a« on the keyboard. Sliding is paused automatically as soon as the user starts navigating. You can disable these controls by specifying ```autoSlideStoppable: false``` in your reveal.js config. + +You can also override the slide duration for individual slides and fragments by using the ```data-autoslide``` attribute: + +```html +
      +

      After 2 seconds the first fragment will be shown.

      +

      After 10 seconds the next fragment will be shown.

      +

      Now, the fragment is displayed for 2 seconds before the next slide is shown.

      +
      +``` + +To override the method used for navigation when auto-sliding, you can specify the ```autoSlideMethod``` setting. To only navigate along the top layer and ignore vertical slides, set this to ```Reveal.navigateRight```. + +Whenever the auto-slide mode is resumed or paused the ```autoslideresumed``` and ```autoslidepaused``` events are fired. + + +### Keyboard Bindings + +If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option: + +```javascript +Reveal.configure({ + keyboard: { + 13: 'next', // go to the next slide when the ENTER key is pressed + 27: function() {}, // do something custom when ESC is pressed + 32: null // don't do anything when SPACE is pressed (i.e. disable a reveal.js default binding) + } +}); +``` + +### Touch Navigation + +You can swipe to navigate through a presentation on any touch-enabled device. Horizontal swipes change between horizontal slides, vertical swipes change between vertical slides. If you wish to disable this you can set the `touch` config option to false when initializing reveal.js. + +If there's some part of your content that needs to remain accessible to touch events you'll need to highlight this by adding a `data-prevent-swipe` attribute to the element. One common example where this is useful is elements that need to be scrolled. + + +### Lazy Loading + +When working on presentation with a lot of media or iframe content it's important to load lazily. Lazy loading means that reveal.js will only load content for the few slides nearest to the current slide. The number of slides that are preloaded is determined by the `viewDistance` configuration option. + +To enable lazy loading all you need to do is change your "src" attributes to "data-src" as shown below. This is supported for image, video, audio and iframe elements. Lazy loaded iframes will also unload when the containing slide is no longer visible. + +```html +
      + + + +
      +``` + + +### API + +The ``Reveal`` object exposes a JavaScript API for controlling navigation and reading state: + +```javascript +// Navigation +Reveal.slide( indexh, indexv, indexf ); +Reveal.left(); +Reveal.right(); +Reveal.up(); +Reveal.down(); +Reveal.prev(); +Reveal.next(); +Reveal.prevFragment(); +Reveal.nextFragment(); + +// Randomize the order of slides +Reveal.shuffle(); + +// Toggle presentation states, optionally pass true/false to force on/off +Reveal.toggleOverview(); +Reveal.togglePause(); +Reveal.toggleAutoSlide(); + +// Shows a help overlay with keyboard shortcuts, optionally pass true/false +// to force on/off +Reveal.toggleHelp(); + +// Change a config value at runtime +Reveal.configure({ controls: true }); + +// Returns the present configuration options +Reveal.getConfig(); + +// Fetch the current scale of the presentation +Reveal.getScale(); + +// Retrieves the previous and current slide elements +Reveal.getPreviousSlide(); +Reveal.getCurrentSlide(); + +Reveal.getIndices(); // { h: 0, v: 0 } } +Reveal.getPastSlideCount(); +Reveal.getProgress(); // (0 == first slide, 1 == last slide) +Reveal.getSlides(); // Array of all slides +Reveal.getTotalSlides(); // total number of slides + +// Returns the speaker notes for the current slide +Reveal.getSlideNotes(); + +// State checks +Reveal.isFirstSlide(); +Reveal.isLastSlide(); +Reveal.isOverview(); +Reveal.isPaused(); +Reveal.isAutoSliding(); +``` + +### Slide Changed Event + +A 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes. + +Some libraries, like MathJax (see [#226](https://github.com/hakimel/reveal.js/issues/226#issuecomment-10261609)), get confused by the transforms and display states of slides. Often times, this can be fixed by calling their update or render function from this callback. + +```javascript +Reveal.addEventListener( 'slidechanged', function( event ) { + // event.previousSlide, event.currentSlide, event.indexh, event.indexv +} ); +``` + +### Presentation State + +The presentation's current state can be fetched by using the `getState` method. A state object contains all of the information required to put the presentation back as it was when `getState` was first called. Sort of like a snapshot. It's a simple object that can easily be stringified and persisted or sent over the wire. + +```javascript +Reveal.slide( 1 ); +// we're on slide 1 + +var state = Reveal.getState(); + +Reveal.slide( 3 ); +// we're on slide 3 + +Reveal.setState( state ); +// we're back on slide 1 +``` + +### Slide States + +If you set ``data-state="somestate"`` on a slide ``
      ``, "somestate" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide. + +Furthermore you can also listen to these changes in state via JavaScript: + +```javascript +Reveal.addEventListener( 'somestate', function() { + // TODO: Sprinkle magic +}, false ); +``` + +### Slide Backgrounds + +Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page backgrounds outside of the slide area by adding a ```data-background``` attribute to your ```
      ``` elements. Four different types of backgrounds are supported: color, image, video and iframe. + +#### Color Backgrounds +All CSS color formats are supported, like rgba() or hsl(). +```html +
      +

      Color

      +
      +``` + +#### Image Backgrounds +By default, background images are resized to cover the full page. Available options: + +| Attribute | Default | Description | +| :--------------------------- | :--------- | :---------- | +| data-background-image | | URL of the image to show. GIFs restart when the slide opens. | +| data-background-size | cover | See [background-size](https://developer.mozilla.org/docs/Web/CSS/background-size) on MDN. | +| data-background-position | center | See [background-position](https://developer.mozilla.org/docs/Web/CSS/background-position) on MDN. | +| data-background-repeat | no-repeat | See [background-repeat](https://developer.mozilla.org/docs/Web/CSS/background-repeat) on MDN. | +```html +
      +

      Image

      +
      +
      +

      This background image will be sized to 100px and repeated

      +
      +``` + +#### Video Backgrounds +Automatically plays a full size video behind the slide. + +| Attribute | Default | Description | +| :--------------------------- | :------ | :---------- | +| data-background-video | | A single video source, or a comma separated list of video sources. | +| data-background-video-loop | false | Flags if the video should play repeatedly. | +| data-background-video-muted | false | Flags if the audio should be muted. | +| data-background-size | cover | Use `cover` for full screen and some cropping or `contain` for letterboxing. | + +```html +
      +

      Video

      +
      +``` + +#### Iframe Backgrounds +Embeds a web page as a slide background that covers 100% of the reveal.js width and height. The iframe is in the background layer, behind your slides, and as such it's not possible to interact with it by default. To make your background interactive, you can add the `data-background-interactive` attribute. +```html +
      +

      Iframe

      +
      +``` + +#### Background Transitions +Backgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing ```backgroundTransition: 'slide'``` to the ```Reveal.initialize()``` call. Alternatively you can set ```data-background-transition``` on any section with a background to override that specific transition. + + +### Parallax Background + +If you want to use a parallax scrolling background, set the first two config properties below when initializing reveal.js (the other two are optional). + +```javascript +Reveal.initialize({ + + // Parallax background image + parallaxBackgroundImage: '', // e.g. "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg" + + // Parallax background size + parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" - currently only pixels are supported (don't use % or auto) + + // Number of pixels to move the parallax background per slide + // - Calculated automatically unless specified + // - Set to 0 to disable movement along an axis + parallaxBackgroundHorizontal: 200, + parallaxBackgroundVertical: 50 + +}); +``` + +Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://revealjs.com/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg¶llaxBackgroundSize=2100px%20900px). + + + +### Slide Transitions +The global presentation transition is set using the ```transition``` config value. You can override the global transition for a specific slide by using the ```data-transition``` attribute: + +```html +
      +

      This slide will override the presentation transition and zoom!

      +
      + +
      +

      Choose from three transition speeds: default, fast or slow!

      +
      +``` + +You can also use different in and out transitions for the same slide: + +```html +
      + The train goes on … +
      +
      + and on … +
      +
      + and stops. +
      +
      + (Passengers entering and leaving) +
      +
      + And it starts again. +
      +``` + + +### Internal links + +It's easy to link between slides. The first example below targets the index of another slide whereas the second targets a slide with an ID attribute (```
      ```): + +```html +Link +Link +``` + +You can also add relative navigation links, similar to the built in reveal.js controls, by appending one of the following classes on any element. Note that each element is automatically given an ```enabled``` class when it's a valid navigation route based on the current slide. + +```html + + + + + + +``` + + +### Fragments +Fragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://revealjs.com/#/fragments + +The default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment: + +```html +
      +

      grow

      +

      shrink

      +

      fade-out

      +

      fade-up (also down, left and right!)

      +

      visible only once

      +

      blue only once

      +

      highlight-red

      +

      highlight-green

      +

      highlight-blue

      +
      +``` + +Multiple fragments can be applied to the same element sequentially by wrapping it, this will fade in the text on the first step and fade it back out on the second. + +```html +
      + + I'll fade in, then out + +
      +``` + +The display order of fragments can be controlled using the ```data-fragment-index``` attribute. + +```html +
      +

      Appears last

      +

      Appears first

      +

      Appears second

      +
      +``` + +### Fragment events + +When a slide fragment is either shown or hidden reveal.js will dispatch an event. + +Some libraries, like MathJax (see #505), get confused by the initially hidden fragment elements. Often times this can be fixed by calling their update or render function from this callback. + +```javascript +Reveal.addEventListener( 'fragmentshown', function( event ) { + // event.fragment = the fragment DOM element +} ); +Reveal.addEventListener( 'fragmenthidden', function( event ) { + // event.fragment = the fragment DOM element +} ); +``` + +### Code syntax highlighting + +By default, Reveal is configured with [highlight.js](https://highlightjs.org/) for code syntax highlighting. To enable syntax highlighting, you'll have to load the highlight plugin ([plugin/highlight/highlight.js](plugin/highlight/highlight.js)) and a highlight.js CSS theme (Reveal comes packaged with the zenburn theme: [lib/css/zenburn.css](lib/css/zenburn.css)). + +Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present, surrounding whitespace is automatically removed. HTML will be escaped by default. To avoid this, for example if you are using `` to call out a line of code, add the `data-noescape` attribute to the `` element. + +```html +
      +
      
      +(def lazy-fib
      +  (concat
      +   [0 1]
      +   ((fn rfib [a b]
      +        (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
      +	
      +
      +``` + +### Slide number +If you would like to display the page number of the current slide you can do so using the ```slideNumber``` and ```showSlideNumber``` configuration values. + +```javascript +// Shows the slide number using default formatting +Reveal.configure({ slideNumber: true }); + +// Slide number formatting can be configured using these variables: +// "h.v": horizontal . vertical slide number (default) +// "h/v": horizontal / vertical slide number +// "c": flattened slide number +// "c/t": flattened slide number / total slides +Reveal.configure({ slideNumber: 'c/t' }); + +// Control which views the slide number displays on using the "showSlideNumber" value: +// "all": show on all views (default) +// "speaker": only show slide numbers on speaker notes view +// "print": only show slide numbers when printing to PDF +Reveal.configure({ showSlideNumber: 'speaker' }); + +``` + + +### Overview mode + +Press "Esc" or "o" keys to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides, +as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks: + +```javascript +Reveal.addEventListener( 'overviewshown', function( event ) { /* ... */ } ); +Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } ); + +// Toggle the overview mode programmatically +Reveal.toggleOverview(); +``` + + +### Fullscreen mode +Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode. + + +### Embedded media +Add `data-autoplay` to your media element if you want it to automatically start playing when the slide is shown: + +```html + +``` + +If you want to enable or disable autoplay globally, for all embedded media, you can use the `autoPlayMedia` configuration option. If you set this to `true` ALL media will autoplay regardless of individual `data-autoplay` attributes. If you initialize with `autoPlayMedia: false` NO media will autoplay. + +Note that embedded HTML5 `