Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Osman Ochoa Osman8a

🎯
Focusing
View GitHub Profile
@Osman8a
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
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
View Object drills 1
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
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
Osman8a / Arrays and Loops Drills
Created Dec 17, 2018
Arrays and Loops Drills
View Arrays and Loops Drills
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
@Osman8a
Osman8a / Array basics drills
Created Dec 17, 2018
Array basics drills completed for the Thinkful course
View Array basics drills
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
@Osman8a
Osman8a / Logic Drills
Created Dec 17, 2018
Logic Drills exercises completed for the Thinkful course
View Logic Drills
Traffic Lights
https://jsbin.com/wowogof/edit?js,console,output
Error Alert
https://jsbin.com/nuhisuw/edit?js,console,output
@Osman8a
Osman8a / Number exercises completed
Created Dec 17, 2018
Number exercises completed for the Thinkful course
View Number exercises completed
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
@Osman8a
Osman8a / completed drills
Created Dec 17, 2018
Completed drills for the Thinkful course
View completed drills
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
You can’t perform that action at this time.