Skip to content

Instantly share code, notes, and snippets.

View dannydi12's full-sized avatar
🎯
Focusing

Daniel Di Venere dannydi12

🎯
Focusing
View GitHub Profile
1) Does the <section> element get nested in the <main> element or is that not following best practices?
2) I don't understand the viewport parameter being passed through the meta tag. What is the purpose? Can't you do things like that with CSS?
3) What if all the header tags aren't the right size for your site? What do you do then?
4) For the link tag, what is the difference between the "rel" and "type" parameters?
5) I understand that charset defines the character encoding but is there no standard encoding that the browser can assume? I've seen some websites with improper encodings where they will end up with random characters where an apostrophe is supposed to be for example.
1) What is the difference between 'let' and 'var'? Don't they do the same thing?
2) I saw the use of a constant data type in the example provided in the module. Why would I want to use 'const' over 'let' and 'var'?
3) Is 'document.createElement()' a part of the DOM API?
4) Is there any resource to help me remember all the different built-in functions available to me in Javascript?
5) Are $(functionName) and function functionName() the same thing?
1) let mentor = "Felix";
2) console.log(mentor);
3) let and const are the newer ways to set a variable in ES6 while var is a pre-ES6 to declare variables. The scopes also differ, apparently. let operates similarly to var but const makes constants which cannot be reassigned a new value.
4) const name = Daniel Di Venere"; var state = "California"; let hair = "brown";
https://repl.it/@dannydi12/Wiseperson-generator-drill
https://repl.it/@dannydi12/shouter-drill
https://repl.it/@dannydi12/text-normalizer-drill
https://repl.it/@dannydi12/area-of-a-rectangle-drill
https://repl.it/@dannydi12/temperature-conversion-drill
https://repl.it/@dannydi12/Is-divisible-drill
https://repl.it/@dannydi12/Traffic-lights-drill
https://repl.it/@dannydi12/Error-alert-drill
https://repl.it/@dannydi12/Creating-arrays-drill
https://repl.it/@dannydi12/Adding-array-items-drills
https://repl.it/@dannydi12/Accessing-array-items-drill
https://repl.it/@dannydi12/Array-length-and-access-drill
https://repl.it/@dannydi12/Array-copying-I-drill
https://repl.it/@dannydi12/Array-copying-II-drill
https://repl.it/@dannydi12/Squares-with-map-drill
https://repl.it/@dannydi12/Sort-drill
https://repl.it/@dannydi12/Filter-drill
https://repl.it/@dannydi12/Find-drill
https://repl.it/@dannydi12/min-and-max-without-sort-drill
https://repl.it/@dannydi12/average-drill
https://repl.it/@dannydi12/fizzbuzz-drill-js
1) Scope is the area in which a variable is declared or referenced. I like to think of it as different classrooms in a school. There might be several students named John in a school, but we can reference a specific student named John based on which classroom they reside in. For example, I can be looking for the John in classroom 1B instead of just any other John in the school. Block and global scope work similarly: I can reference a specific variable that belongs to a function (block scope) or I can enlarge my scope of reference and find a variable higher up in the scope chain (global scope).
2) Global variables need to be avoided to prevent bugs and unintended side effects. It might be more convenient when you first start writing your code. However, it will quickly devolve into an unmanageable mess as your code starts to behave in ways you didn't intend (aka the AI uprising). Do you really want to be responsible for the end of humanity?
3) Javascript's strict mode can help you maintain more manageable code b
https://repl.it/@dannydi12/Object-creator-drill
https://repl.it/@dannydi12/Object-updater-drill
https://repl.it/@dannydi12/Self-reference-drill
https://repl.it/@dannydi12/Deleting-keys-drill