Skip to content

Instantly share code, notes, and snippets.

View markLaughlin's full-sized avatar

Mark Laughlin markLaughlin

View GitHub Profile
@markLaughlin
markLaughlin / gist:1bb40490311b5b49395026bb0ff37c8f
Created March 4, 2019 22:06
Links to completed Strings Drill
https://repl.it/@mlaughlin70/Strings-Drill-One
https://repl.it/@mlaughlin70/Strings-Drill-Two
https://repl.it/@mlaughlin70/Strings-Drill-Three
@markLaughlin
markLaughlin / gist:be991c2158b46a9a7754a4ec4bfb0fd5
Last active March 5, 2019 22:03
JavaScript Numbers Drill
https://repl.it/@mlaughlin70/Is-divisible-drill
https://repl.it/@mlaughlin70/temperature-conversion-drill
https://repl.it/@mlaughlin70/area-of-a-rectangle-drill
https://repl.it/@mlaughlin70/Traffic-lights-drill
https://repl.it/@mlaughlin70/Error-alert-drill
@markLaughlin
markLaughlin / gist:a8bf34f94c51e2d96475d129abd2dd57
Created March 9, 2019 22:30
Links to JavaScript array drills
https://repl.it/@mlaughlin70/Accessing-array-items-drill
https://repl.it/@mlaughlin70/Array-length-and-access-drill
https://repl.it/@mlaughlin70/Array-copying-I-drill
https://repl.it/@mlaughlin70/Array-copying-II-drill
https://repl.it/@mlaughlin70/Squares-with-map-drill
https://repl.it/@mlaughlin70/Sort-drill
https://repl.it/@mlaughlin70/Filter-drill
https://repl.it/@mlaughlin70/Find-drill
@markLaughlin
markLaughlin / gist:456a556ee3f700bb2648840319dc9787
Created March 10, 2019 21:34
Links to loops and arrays drills
https://repl.it/@mlaughlin70/min-and-max-without-sort-drill
https://repl.it/@mlaughlin70/average-drill
https://repl.it/@mlaughlin70/fizzbuzz-drill-js
Question One:
A variable's scope is the area of the code where a change in the value of the variable takes effect. If a variable has global scope, then changing its value in any line of the program changes its value everywhere in the program. By contrast, if a variable has block scope, changing its value within a function only changes its value within that same function; everywhere else in the program, the value stays the same. A variable with global scope is declared outside of a function, and a varible with block scope is declared within a function.
Question Two:
c This becomes critical when multiple people are contributing to the same project and assign different values to the same variable name. One person can knowingly or unknowingly change the value of a global variable and inadvertently sabotage other parts of the project. Essentially, using global variables leads to code that is full of bugs and is generally confusing.
Question Three:
https://repl.it/@mlaughlin70/Object-creator-drill
https://repl.it/@mlaughlin70/Object-updater-drill
https://repl.it/@mlaughlin70/Self-reference-drill
https://repl.it/@mlaughlin70/Deleting-keys-drill
The following is an attempt to follow the flow of control of the program.
Flow begins at mostFrequent function:
-The mostFrequent word function begins; it takes some text as a parameter.
-The variable words is declared and initialized to the result of the function getTokens, which takes text as a parameter.
Flow goes to getTokens Function:
-The getTokens function begins; it takes a rawString as a parameter, in the case of our program, it takes takes text.
I am seeing ways of embedding the jQuery requests directly into the html file rather than having them on a seperate .js file. Which way is better?
jQuery seems like a shortcut. Would it perhaps be better to learn how to code everything in JavaScript first?
In a directory with an .html file, a .css file and a .js file, which file is being compiled first, the .css file or the .js file?
The following part of a jQuery event seems to have the wrong syntax with parentheses. Why is that? $(".jsClicker").click.function(event){ }
How does qQuery work with form elements?
@markLaughlin
markLaughlin / gist:85012d6d989a7a013c75507ee2e1a913
Last active March 31, 2019 22:06
"Shopping List: Render the List" Checkpoint Exercise
ADD ITEMS:
Create a function that binds the action of the form with the id "#js-shopping-list-form" being submitted to a function.
This function will assign the value inside the input box with id ""#shopping-list-entry" to a variable name.
This variable will be used to create an entirely new <ls> element to eventually be added into the DOM.
CHECK/UNCHECK ITEMS: