Skip to content

Instantly share code, notes, and snippets.

@martellinick
martellinick / gist:15fe7f66b35137b0aad034f0d03a897c
Created July 24, 2019 01:38
Working with strings : drills
https://repl.it/@martellinick/text-normalizer-drill
https://repl.it/@martellinick/shouter-drill
https://repl.it/@martellinick/Wiseperson-generator-drill
What is scope? Your explanation should include the idea of global vs. block scope.
Scope is how the variables within your code can or can't be accessed at different points within your code. Global scope is
when a variable can be accessed from anywhere within your code. This means that any code not declared within block code can
be accessed globally. Block scope is when variables can only be accessed within a function and outside of that function
they don't exist.
Why are global variables avoided?
Global variables are avoided because they can have unintended consequences on other areas of the code. If a global variable
were to be used in a function without the use of "let" or "const", that global would be accessed and altered which would
then change any other functions that access that global variable.
https://repl.it/@martellinick/Object-creator-drill
https://repl.it/@martellinick/Object-updater-drill
https://repl.it/@martellinick/Self-reference-drill
https://repl.it/@martellinick/Deleting-keys-drill
https://repl.it/@martellinick/most-frequent-word-analyzer-challenge
Questions 
From what tree do acorns come? Oak (false answers: pine, fir, maple)

Saint Patrick is the Patron Saint of which country? Ireland (false answers: scotland, britain, japan)

How many colours are in a rainbow? 7 (false answers: 5, 12, 9)

What does Fred Flintstone wear around his neck? A tie (false answers: nothing, pearl necklace, dinosaur tooth)

What is the name of Harry Potter’s pet owl? Hedwig (false answers: ludwig, froto, heimdahl)

What food do Giant Pandas normally eat? Bamboo (false answers: japanese maple, wild carrots, small animals)

What is the name of the boy that visits the chocolate factory owned by Willy Wonka? Charlie Bucket (false answers: James Bloom, Bob, Chester Freed)

How many days are there in a fortnight? 14 (false answers: 31, 7, 21)