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
function getTokens (rawString) { | |
// NB: `.filter (Boolean)` removes any false items from an array | |
return rawString.toLowerCase (). split (/ [,!. ";: -] + /). filter (Boolean) .sort (); | |
} | |
function mostFrequentWord (text) { | |
// asgina a words the divided and organized string | |
var words = getTokens (text); | |
var wordFrequencies = {}; | |
// I walk the words vector |
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
Make student reports | |
https://jsbin.com/kolijuv/edit?html,js,console | |
Enroll in summer school | |
https://jsbin.com/mogibef/edit?html,js,console | |
Find by id | |
https://jsbin.com/fanugap/edit?html,js,console | |
Validate object keys |
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
Object creator | |
https://jsbin.com/quhezax/edit?html,js,console | |
Object updater | |
https://jsbin.com/hidumev/edit?html,js,console | |
Self reference | |
https://jsbin.com/yinuqaw/edit?html,js,console | |
Deleting keys |
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
A) What is scope? Your explanation should include the idea of global vs. local scope. | |
R= the scope defines how you can or can not access the variables that you declare in different points of your code. | |
When you declare a variable in the global scope, it is available throughout the code. | |
When you declare a variable in the local scope, it will be available only within the function | |
B) Why are global variables avoided? | |
R= the use of global variables can generate unintentional errors in my code when I have local variables called in the same way |
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
max and min (without sort) | |
https://jsbin.com/rapavu/edit?html,js,output | |
Compute the average | |
https://jsbin.com/hedujox/edit?html,js,console | |
FizzBuzz | |
https://jsbin.com/juzebox/edit?html,js,console |
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
Creating arrays | |
https://jsbin.com/romusos/edit?html,js,console | |
Adding array items | |
https://jsbin.com/gobapig/edit?html,js,console | |
Accessing array items | |
https://jsbin.com/pavedaz/edit?html,js,console | |
Array length and access |
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
Traffic Lights | |
https://jsbin.com/wowogof/edit?js,console,output | |
Error Alert | |
https://jsbin.com/nuhisuw/edit?js,console,output |
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
Area of a Rectangle | |
https://jsbin.com/koredof/edit?html,js,console | |
Temperature Conversion | |
https://jsbin.com/libozod/edit?html,js,console | |
Is Divisible | |
https://jsbin.com/yemadel/edit?html,js,console |
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
Wiseperson generator | |
https://jsbin.com/bozovoz/edit?html,js | |
Shouter | |
https://jsbin.com/guhutux/edit?html,js,console | |
Text normalizer | |
https://jsbin.com/sodozuh/edit?html,js,output |