Skip to content

Instantly share code, notes, and snippets.


Osman Ochoa Osman8a

View GitHub Profile
Osman8a / gist:5deb8a9af271778ee84c1304e3ce8da1
Created Dec 19, 2018
Challenge: analyze a most frequent word program
View gist:5deb8a9af271778ee84c1304e3ce8da1
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
View Objects drills 2
Make student reports,js,console
Enroll in summer school,js,console
Find by id,js,console
Validate object keys
View Object drills 1
Object creator,js,console
Object updater,js,console
Self reference,js,console
Deleting keys
View gist:01996e2463a81ee99efdebf253dfc174
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
Osman8a / Arrays and Loops Drills
Created Dec 17, 2018
Arrays and Loops Drills
View Arrays and Loops Drills
max and min (without sort),js,output
Compute the average,js,console
Osman8a / Array basics drills
Created Dec 17, 2018
Array basics drills completed for the Thinkful course
View Array basics drills
Creating arrays,js,console
Adding array items,js,console
Accessing array items,js,console
Array length and access
Osman8a / Logic Drills
Created Dec 17, 2018
Logic Drills exercises completed for the Thinkful course
View Logic Drills
Traffic Lights,console,output
Error Alert,console,output
Osman8a / Number exercises completed
Created Dec 17, 2018
Number exercises completed for the Thinkful course
View Number exercises completed
Area of a Rectangle,js,console
Temperature Conversion,js,console
Is Divisible,js,console
Osman8a / completed drills
Created Dec 17, 2018
Completed drills for the Thinkful course
View completed drills
Wiseperson generator,js
Text normalizer,js,output