Skip to content

Instantly share code, notes, and snippets.

View matthewmjm's full-sized avatar

Matthew Malecki matthewmjm

  • Flatiron School
  • Denver, CO
View GitHub Profile
@matthewmjm
matthewmjm / scope.txt
Created December 8, 2016 19:35
we'd like you to write short (~1-2 paragraphs max) answers to the following questions
Questions
What is scope? Your explanation should include the idea of global vs. local scope.
Scope defines how a variable may be accessed, or not accessed, at different points in the code. There are two types of scope:
global scope and local scope. A variable declared outside a function is considered global scope and is able to be accessed
through-out your code. A variable declared within a function is considered local scope and can only be accessed within the
function to where it resides.
Why are global variables avoided?
Global variables can cause uninteded side effects causing the code to be indeterminate which can yield different output given
the same imput. Thereby creating code that can be difficult to debug.
@matthewmjm
matthewmjm / gist:fbd46a6bbe6d5b86aa882c4f6fbc017c
Created December 3, 2016 01:09
JavaScript Number Drills
Square Area: http://jsbin.com/vezucav/edit?html,js,console
Temperature Conversion: http://jsbin.com/rocapis/edit?html,js,console
Is Divisible: http://jsbin.com/woxuli/edit?html,js,console
@matthewmjm
matthewmjm / gist:541450da5dd15b12d07372d397604f73
Created December 2, 2016 20:57
JavaScript String Drills
Wiseperson generator: http://jsbin.com/liyaweb/edit?html,js,console
Shouter: http://jsbin.com/lavezu/edit?html,js,console
Text normalizer: http://jsbin.com/coxopun/edit?html,js,console