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
| DROP TABLE IF EXISTS notes; | |
| CREATE TABLE notes ( | |
| id serial PRIMARY KEY, | |
| title text NOT NULL, | |
| content text, | |
| created timestamp DEFAULT now() | |
| ); |
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://repl.it/@Bandada/Cat-carousel-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) { // A function is being created. It isn't anonymous. It has the name getTokens. The argument is rawString. | |
| // NB: `.filter(Boolean)` removes any falsy items from an array // A comment | |
| return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort(); // Argument is being returned lower case. String is being split into substrings. Boolean is filtering. Sort is sorting. | |
| } | |
| function mostFrequentWord(text) { // New function being created with text as an argument | |
| let words = getTokens(text); // Variable called words being created. Getting set equal to first function. | |
| let wordFrequencies = {}; // New object being created. Variable it is set to is wordFrequencies | |
| for (let i = 0; i <= words.length; i++) { // For loop being created. It runs as long as i is less than words.length. Increments by 1 each time | |
| if (words[i] in |
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://repl.it/@Bandada/Make-student-reports-drill-1 |
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://repl.it/@Bandada/Object-creator-drill |
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
| QUESTION: What is scope? Your explanation should include the idea of global vs. local scope. | |
| ANSWER: | |
| Scope is essentially a set of rules that define which parts of your code can access a particular variable. Scope is what | |
| allows us to reuse variables at different points in our code without it breaking. With regards to global scope, rules set | |
| there can affect the entirety of the code. With regards to local scope, rules set there only impact the code on a local | |
| level, such as within a function itself. | |
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://repl.it/@Bandada/min-and-max-without-sort-drill-1 |
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://repl.it/@Bandada/Array-copying-I-drill |
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://repl.it/@Bandada/Creating-arrays-drill |
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://repl.it/@Bandada/Traffic-lights-drill |
NewerOlder