Skip to content

Instantly share code, notes, and snippets.

View FrancesFisk's full-sized avatar

Frances Fisk FrancesFisk

  • Los Angeles, CA
View GitHub Profile
Cat carousel: https://repl.it/@FrancesDFisk/Cat-carousel-jQuery
FizzBuzz revisited: https://repl.it/@FrancesDFisk/return-of-fizz-buzz
Make Student Reports: https://repl.it/@FrancesDFisk/Make-student-reports-drill
Enroll in summer school: https://repl.it/@FrancesDFisk/Enroll-in-summer-school-drill
Find by Id: https://repl.it/@FrancesDFisk/find-by-id-drill
Validate Object Keys: https://repl.it/@FrancesDFisk/validate-object-keys-drill
Object creator: https://repl.it/@FrancesDFisk/Object-creator-drill
Object updater: https://repl.it/@FrancesDFisk/Object-updater-drill
Self-reference: https://repl.it/@FrancesDFisk/Self-reference-drill
Deleting keys: https://repl.it/@FrancesDFisk/Deleting-keys-drill
@FrancesFisk
FrancesFisk / gist:fd98b87e8b8af50b7f0734bddd39e639
Created February 2, 2018 17:34
Scope - In your own words
What is scope? Your explanation should include the idea of global vs. local scope.
Scope refers to the accessibility of variables. They can be either global or local. Variables in the global scope are declared outside of functions. They can be accessed and manipulated by functions. Variables in the local scope are declared within a function. They can be manipulated only by the function it's written in. Other functions cannot access and manipulate them.
Why are global variables avoided?
Global variables should be avoided considering that they have potential to be the source of bugs. Since several functions can access them, they could be changed by multiple functions multiple times. This can cause the value to be lost or confused. It's better to declare variables locally so that the function it's inside is the only function that can manipulate it. That way, the variable's value is easier to keep track of since it's contained.
Explain JavaScript's strict mode
Strict mode enables an error alert when there
Max and min (without sort): https://repl.it/@FrancesDFisk/min-and-max-without-sort-drill
Compute the Average: https://repl.it/@FrancesDFisk/average-drill
FizzBuzz: https://repl.it/@FrancesDFisk/fizzbuzz-drill-js-1
Array Copying 1: https://repl.it/@FrancesDFisk/Array-copying-I-drill
Array Copying 2: https://repl.it/@FrancesDFisk/Array-copying-II-drill-1
Squares with Map: https://repl.it/@FrancesDFisk/Squares-with-map-drill
Sort: https://repl.it/@FrancesDFisk/Sort-drill
Filter: https://repl.it/@FrancesDFisk/Filter-drill
Creating Arrays: https://repl.it/@FrancesDFisk/Creating-arrays-drill
Adding Array items: https://repl.it/@FrancesDFisk/Adding-array-items-drills
Accessing Array items: https://repl.it/@FrancesDFisk/Accessing-array-items-drill
Array Length and Access: https://repl.it/@FrancesDFisk/Array-length-and-access-drill
Traffic Lights: https://repl.it/@FrancesDFisk/Traffic-lights-drill
Error Alert: https://repl.it/@FrancesDFisk/Error-alert-drill
Area of a rectangle: https://repl.it/@FrancesDFisk/area-of-a-rectangle-drill
Temperature conversion: https://repl.it/@FrancesDFisk/temperature-conversion-drill
Is Divisible: https://repl.it/@FrancesDFisk/Is-divisible-drill
Wiseperson generator: https://repl.it/@FrancesDFisk/Wiseperson-generator-drill
Shouter: https://repl.it/@FrancesDFisk/shouter-drill
Text Normalizer: https://repl.it/@FrancesDFisk/text-normalizer-drill-1