- 10 Interview Questions Every JavaScript Developer Should Know
- The Two Pillars of JavaScript
- Why I use Tape Instead of Mocha & So Should You
- A Simple Challenge to Classical Inheritance Fans
- Assessing Employee Performance
- How to Use Classes and Sleep at Night
- A curated list of resources on why ES6 (aka ES2015) classes are NOT awesome
- [Composition in Javascript](http://rjzaworski.com/2
This file contains 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
export type Matcher<T> = (query: string) => T[]; | |
export type ValueProject<T> = (target: T) => Array<string | number>; | |
export type MatcherFactory = <T>(targets: T[], project: ValueProject<T>) => Matcher<T>; | |
export const defaultProject = <T>(target: T) => Object.values(target); | |
const isMatchable = prop => typeof prop == 'number' || typeof prop == 'string' | |
This file contains 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
// zip arrays together | |
// Catalin Dumitru @colin_dumitru | |
// Jason Awbrey @jsawbrey | |
const zip = (a, b) => a.map((n, i) => [n, b[i]]) | |
// merge objects in an array together | |
// caution: properties are overridden if duplicated | |
// @a [{a},{b}] | |
// @returns [{a, b}] | |
// Jason Awbrey @jsawbrey |
This file contains 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
/** | |
Taken from: http://stackoverflow.com/questions/588040/window-onload-vs-document-onload | |
According to Parsing HTML documents - The end, | |
The browser parses the HTML source and runs deferred scripts. | |
A DOMContentLoaded is dispatched at the document when all the HTML has been parsed and have run. The event bubbles to the window. | |
The browser loads resources (like images) that delay the load event. | |
A load event is dispatched at the window. | |
Therefore, the order of execution will be | |
DOMContentLoaded event listeners of window in the capture phase | |
DOMContentLoaded event listeners of document |
This file contains 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
const flatMap = (fn, stream, resultSelector) => | |
stream.flatMap((x, xi) => fn(x).map((y, yi) => resultSelector(x, y, xi, yi))); | |
const flatMapLatest = (fn, stream) => | |
stream.publish(s => s.flatMap(v => fn(v).takeUntil(s))); | |
const flatMapLatest = (fn, stream, resultSelector) => stream.publish(s => { | |
return s.flatMap(v => fn(v), resultSelector).takeUntil(s)); | |
}); |
(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.