Skip to content

Instantly share code, notes, and snippets.

View Osman8a's full-sized avatar
🎯
Focusing

Osman Ochoa Osman8a

🎯
Focusing
View GitHub Profile
@Osman8a
Osman8a / completed drills
Created December 17, 2018 03:55
Completed drills for the Thinkful course
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
@Osman8a
Osman8a / Number exercises completed
Created December 17, 2018 05:02
Number exercises completed for the Thinkful course
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 / Logic Drills
Created December 17, 2018 06:05
Logic Drills exercises completed for the Thinkful course
Traffic Lights
https://jsbin.com/wowogof/edit?js,console,output
Error Alert
https://jsbin.com/nuhisuw/edit?js,console,output
@Osman8a
Osman8a / Array basics drills
Created December 17, 2018 21:43
Array basics drills completed for the Thinkful course
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 / Arrays and Loops Drills
Created December 17, 2018 22:56
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 / 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
Osman8a / Object drills 1
Created December 18, 2018 03:27
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
@Osman8a
Osman8a / Objects drills 2
Created December 19, 2018 02:44
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
@Osman8a
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