git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| HTML | |
| - Semantic HTML | |
| - Event delegation | |
| - Accessibility / ARIA | |
| CSS | |
| - Specificity | |
| - Pseudo-elements | |
| - Pseudo-selectors | |
| - Combinators |
| Data Structures | |
| - Stacks | |
| - Queues | |
| - Linked lists | |
| - Graphs | |
| - Trees | |
| - Tries | |
| Concepts | |
| - Big O Notation |
| const arr = N => Array.from({ length: N }, (_, i) => i) | |
| // Notice that the first parameter of the function is the "length" just as when you get the arr.length , you define it. | |
| // And the second parameter is the mapping function. | |
| // Since our new array does not have items within it, we skip the first argument with _ and take the index i to return it => i as it will follow the linear increasing logic 0, 1, 2... |
| function diffArray(arr1, arr2) { | |
| return [...arguments].reduce((a, c) => { | |
| if (!arr1.includes(c) || !arr2.includes(c)) { a.push(c) } | |
| return a | |
| }, []) | |
| } | |
| console.log(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5])) // [ 4 ] |
| function destroyer(arr) { | |
| const destroyArgs = [...arguments].slice(1) | |
| return arguments[0].filter((val) => { | |
| return !destroyArgs.includes(val) | |
| }) | |
| } | |
| // const destroyer = (arr, ...valsToRemove) => arr.filter(elem => !valsToRemove.includes(elem)); |
| const countBits = (n) => n.toString(2).split('').filter(e => e === '1').length |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| function shuffle(array) { | |
| for (let i = array.length - 1; i > 0; i--) { | |
| const j = Math.floor(Math.random() * (i + 1)) | |
| ;[array[i], array[j]] = [array[j], array[i]] | |
| } | |
| return array | |
| } | |
| // Snippet by Sarah Drasner | |
| // More shuffling ---> https://bost.ocks.org/mike/shuffle/ |
| columnHeadingMap() { | |
| return this.columnKeys.reduce((acc, curr, index) => { | |
| acc[curr] = this.germanValues[index] | |
| return acc | |
| }, {}) | |
| }, | |
| // maps/reduces 2 arrays into an new object | |
| // vue computed |