Skip to content

Instantly share code, notes, and snippets.

View Osman8a's full-sized avatar

Osman Ochoa Osman8a

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