This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
set ruler " Show the line and column numbers of the cursor. | |
set formatoptions+=o " Continue comment marker in new lines. | |
set textwidth=0 " Hard-wrap long lines as you type them. | |
set modeline " Enable modeline. | |
set esckeys " Cursor keys in insert mode. | |
set linespace=0 " Set line-spacing to minimum. | |
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) | |
" More natural splits | |
set splitbelow " Horizontal split below current. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//makes an array of tokes-> objects and other keywords that arent falsey no upper case | |
function getTokens(rawString) { | |
// NB: `.filter(Boolean)` removes any falsy items from an array | |
return rawString.toLowerCase() //lower case | |
.split(/[ ,!.";:-]+/) // using a Regex splits array into array indeces that are separated by any of the following: [ ,!.";:-]+ | |
.filter(Boolean) //filter returns an array that is a modified version of this object. only items that evaluate to true using the Boolean conversion function are passed to the new array This means that anything that is false is removed. this is a bit redundant as taking a string and splitting it already encapsulates falsy stuff in ''. Any falsy keywords are caught by error handling. passing an empty string will however result in undefined opposed to getting thru as '' as it normally is falsy. it also filters empty arrays[] but not a weird one `${{}}` which are "[object". | |
.sort(); //sorts by alphabetical and numberical ascending by default | |
} | |
function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://repl.it/@MrNanosh/Make-student-reports-drill | |
https://repl.it/@MrNanosh/Enroll-in-summer-school-drill | |
https://repl.it/@MrNanosh/find-by-id-drill | |
https://repl.it/@MrNanosh/validate-object-keys-drill | |
Alternate solution for drill 4: https://repl.it/@MrNanosh/validate-object-keys-drill-2nd-way |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://repl.it/@MrNanosh/Object-creator-drill | |
https://repl.it/@MrNanosh/Object-updater-drill | |
https://repl.it/@MrNanosh/Self-reference-drill | |
https://repl.it/@MrNanosh/Deleting-keys-drill?lite=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is scope? Your explanation should include the idea of global vs. block scope. | |
Scope is realm of influence of a variable. So long as var is avoided the only two scopes to be concerned with are global and block. variables declared with either let or const can exhibit both types of scope. Generally a variable declared in either way is defined within the block where it is declared and by extension any of the blocks nested within like russian dolls. Blocks are between curly "{}" braces. Any variable that is redefined within an inner block without being re-instantiated will be redefined for the outter block as well. | |
Global variables are defined and instantiated outside of any function and can be seen by even other javascript files that are loaded after the original. This means that they are defined and incidentally re-definable in every other block that is loaded after! | |
Why are global variables avoided? | |
Global files should be avoided because of the general problem of unintended concequences. Glbal variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://repl.it/@MrNanosh/min-and-max-without-sort-drill | |
https://repl.it/@MrNanosh/average-drill | |
https://repl.it/@MrNanosh/fizzbuzz-drill-js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://repl.it/@MrNanosh/Creating-arrays-drill | |
https://repl.it/@MrNanosh/Adding-array-items-drills | |
https://repl.it/@MrNanosh/Accessing-array-items-drill | |
https://repl.it/@MrNanosh/Array-length-and-access-drill | |
https://repl.it/@MrNanosh/Array-copying-I-drill | |
https://repl.it/@MrNanosh/Array-copying-II-drill | |
https://repl.it/@MrNanosh/Squares-with-map-drill | |
https://repl.it/@MrNanosh/Sort-drill | |
https://repl.it/@MrNanosh/Filter-drill | |
https://repl.it/@MrNanosh/Find-drill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://repl.it/@MrNanosh/Traffic-lights-drill | |
https://repl.it/@MrNanosh/Error-alert-drill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://repl.it/@MrNanosh/area-of-a-rectangle-drill | |
https://repl.it/@MrNanosh/temperature-conversion-drill | |
https://repl.it/@MrNanosh/Is-divisible-drill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Links to solutions: | |
https://repl.it/@MrNanosh/Wiseperson-generator-drill | |
https://repl.it/@MrNanosh/shouter-drill | |
https://repl.it/@MrNanosh/text-normalizer-drill |
NewerOlder