This file contains 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
1. getToken function takes a raw string converted to an array consisted words. | |
All words in that array are in lower cases, no punctuations and falsy items, sorted by alphabetical order. | |
2. mostFrequentWord function takes a raw string and use getToken to covert it to tokens. | |
Then build a dictionary (hash map) to count all words' frequency. Then use a loop to find the most frequent word. |
This file contains 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
1. https://repl.it/@BridgeNB/Make-student-reports-drill | |
2. https://repl.it/@BridgeNB/Enroll-in-summer-school-drill | |
3. https://repl.it/@BridgeNB/find-by-id-drill | |
4. https://repl.it/@BridgeNB/validate-object-keys-drill |
This file contains 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
1. https://repl.it/@BridgeNB/Object-creator-drill-2 | |
2. https://repl.it/@BridgeNB/Object-updater-drill-1 | |
3. https://repl.it/@BridgeNB/Self-reference-drill | |
4. https://repl.it/@BridgeNB/Deleting-keys-drill |
This file contains 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
1. Scope is the range where variables are defined and validated. Global scope is the environment | |
where variables are available everywhere in this project. | |
Local scope is a particular area where variables are vaildated, for example, a function or a file. | |
2. We have to avoid global variables to aviod misrable bugs. | |
3. In strict mode, you cannot use a variable without defined it first. | |
4. Side effects is that one function's output will affect other functions. | |
Pure funtion is that this function is both determinate and has no side affect. |