I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
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
// No dependencies! + 1 point | |
// Only one API to reference! + 1 point | |
const Widget = { | |
// Expose desired data directly using destructuring! + 1 point | |
controller({initialValue}) { | |
// No more retrieving references buried by the superclass! + 1 point | |
this.counter = initialValue; | |
// Two less methods! + 2 points | |
}, |
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
/***************************************** | |
/* DOM touch support module | |
/*****************************************/ | |
if (!window.CustomEvent) { | |
window.CustomEvent = function (event, params) { | |
params = params || { bubbles: false, cancelable: false, detail: undefined }; | |
var evt = document.createEvent('CustomEvent'); | |
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | |
return evt; | |
}; |
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
var mod = ( function initModulator(){ | |
if( !Map ){ | |
// A naive shim for maps functionality | |
var Map = shim; | |
var WeakMap = shim; | |
} | |
// Registry of instantiation contexts | |
var contexts = new WeakMap(); | |
// All automated counts |
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
nodejs-deps: | |
pkg.installed: | |
- names: | |
- g++ | |
- curl | |
- libssl-dev | |
- apache2-utils | |
require: | |
- pkg: git |
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
// `promise` is some operation that may succeed (fulfill) or fail (reject) | |
var newPromise = promise.then( | |
function () { | |
return delay(1000); | |
}, | |
writeError | |
); | |
// If `promise` fulfills, `newPromise` will fulfill in 1000 ms. | |
// If `promise` rejects and writing to the error log succeeds, |