Skip to content

Instantly share code, notes, and snippets.

View joelcorey's full-sized avatar

Joel Corey joelcorey

  • Clatskanie, Oregon
View GitHub Profile
@joelcorey
joelcorey / gist:f9a0533a98624a735d216aa2c08f5a8d
Created February 22, 2019 13:29
Mentor jQuery questions
Has native JavaScript mostly caught up to jQuery?
When using libraries such as React, how much of a role does jQuery play?
Is jQuery "on the job" increasing or decreasing?
Or is it mostly remaining the same?
If it's sticking around, what's the future of it look like? And what is something you wish jQuery did .. or did better ?
https://repl.it/@joelcorey/Make-student-reports-drill
https://repl.it/@joelcorey/Enroll-in-summer-school-drill
https://repl.it/@joelcorey/find-by-id-drill
https://repl.it/@joelcorey/validate-object-keys-drill
Scope is the "area" in which a variable lives. Unless dealing with specific use cases, such as a library, variables should be kept out of global scope. A function should have one job (single responsibility). This also falls in line with KISS (Keep It Simple Stupid), makes your code easier to read, and easier to maintain. JavaScript's sctrict mode, "use strict;", forces you to use "let" and "const" when declaring variables. This is best practice, and should be how you code. When a function reaches outside of the scope in which it should exist, it can have unintended side effects. A side effect is bad and can be avoided by not using globals. A pure function is when a functions output is only determined by its input.