This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://coleenhuang.github.io/Ancient-Greece-quiz/greek-quiz-app | |
| https://github.com/coleenhuang/Ancient-Greece-quiz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const questions = [ | |
| { //Question 1 | |
| text: "Μῆνιν ἄειδε, θεά, Πηληϊάδεω Ἀχιλῆος is the opening line of a famous work." | |
| + "What is that work called?", | |
| answers: [ | |
| { | |
| text: "Seven Against Thebes", | |
| correct: false | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| addItems(){ | |
| //Get imput value from the form | |
| //Take the input value and put it in an object that is added to the array STORE | |
| //STORE.push({name: item, checked: false}) | |
| } | |
| checkItems(){ | |
| //use event listener on the check button | |
| //change the value for the item in STORE from checked: false to checked: true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Publishing a project page for a project with existing repository | |
| //Make sure you are in the local project repo | |
| $ git checkout -b gh-pages | |
| $ git push origin gh-pages | |
| Keep gh-pages up to date with a master branch | |
| // Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/ | |
| $ git add . | |
| $ git status // to see what changes are going to be commited |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| What are the ways that jQuery can be used to manipulate the appearance of a web page? | |
| How do you use jQuery to add additional text to a web page? | |
| Do you need to link to jQuery in the html file? | |
| Is jQuery the only way you can interact with the DOM? | |
| How would you extract information from forms with jQuery? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getTokens(rawString) { | |
| // NB: `.filter(Boolean)` removes any falsy items from an array | |
| return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort(); | |
| //converts all the letters in the string to lowercase, splits the string into an array of individual words, removes any falsy items, and sorts it all alphabetically. | |
| } | |
| function mostFrequentWord(text) { | |
| let words = getTokens(text); | |
| //calls the function getTokens and assigns the output to words | |
| //makes words an array of the individual words from the argument, sorted alphabetically, in lowercase and without punctuation or spaces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Scope is where a variable can be accessed from in your program. Block scope means that the variable can only be accessed from within the block where it is declared. Whereas variables with global scope can be accessed from anywhere in the program. | |
| Global variables are usually avoided due to the unintended side effects that can happen, which can often lead to bugs. Side effects are when a variable in a function reaches out of the local scope and changes the value of the global variable. | |
| This can cause a function to become indeterminate, which means that it returns different values despite having the same inputs. A pure function is determinate, always returning the same values for the sames inputs, and has no side effects, so only changes variables within the local scope. | |
| Strict mode triggers an error whenever a function is declared without let or const. It prevents you from accidentally declaring a global variable within a function. | |
NewerOlder