- Tram 19 (17 minutes):
http://www.muenchen.de/verkehr/oeffentlicher-nahverkehr/tram/tram19.html (German only)- Enter: at Hauptbahnhof, tram 19 (direction St.-Veit-Straße)
- Leave: at Ostbahnhof (obviously, you can pause your tour in between, too)
- Bus 100 ("Museumslinie") (via @ho1ger)
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
// Proof of concept only! | |
function isInstance(value, Type) { | |
if (typeof Type.hasInstance === 'function') { | |
return Type.hasInstance(value); | |
} else { | |
return value instanceof Type; | |
} | |
} | |
isInstance.Primitive = { |
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
Primitive | |
PrimitiveBoolean | |
PrimitiveNumber | |
PrimitiveString | |
ValueObject | |
(Future: user-defined value classes) | |
ReferenceObject | |
(Objects that are not an instance of Object) | |
Object | |
(Subclasses of Object) |
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
//--------------------- | |
// AMD | |
define(["foo", "bar", "baz"], function (foo, bar, baz) { | |
return { | |
func: function (...) { ... } | |
}; | |
}); | |
//--------------------- |
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
(function (glob) { | |
// glob points to global object | |
}(typeof window !== 'undefined' ? window : global)); |
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
/** | |
* Create an array with `len` elements. | |
* | |
* @param [initFunc] Optional: a function that returns | |
* the elements with which to fill the array. | |
* If the function is omitted, all elements are `undefined`. | |
* `initFunc` receives a single parameter: the index of an element. | |
*/ | |
function initArray(len, initFunc) { | |
if (typeof initFunc !== 'function') { |
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
function newOperator(Constr, args) { | |
var inst = Object.create(Constr.prototype); | |
var result = Constr.apply(inst, args); | |
if (typeof result === 'object' && result !== null) { | |
return result; | |
} | |
return inst; | |
} |
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 BIG_ENDIAN = Symbol('BIG_ENDIAN'); | |
const LITTLE_ENDIAN = Symbol('LITTLE_ENDIAN'); | |
function getPlatformEndianness() { | |
let arr32 = new Uint32Array([0x12345678]); | |
let arr8 = new Uint8Array(arr32.buffer); | |
switch ((arr8[0]*0x1000000) + (arr8[1]*0x10000) + (arr8[2]*0x100) + (arr8[3])) { | |
case 0x12345678: | |
return BIG_ENDIAN; | |
case 0x78563412: | |
return LITTLE_ENDIAN; |
Question: If a newcomer to JavaScript asked you for essential libraries and tools, what would you tell them? You don’t want to overwhelm them with too many suggestions!
Focus: language-related functionality (as opposed to browser-related functionality).
- Libraries: including, say, Underscore.js and promises libraries, but excluding jQuery et al.
- Tools: package managers, build tools, unit test tools, etc.
- Less important: editors, IDEs. Rationale: it’s fairly obvious that you need them. There are other tools that people might not even know that they need.
- Overview of a workflow based on
env
: http://2ality.com/2017/07/npm-packages-via-babel.html env
has the optionuseBuiltins
that helps with polyfilling the standard library: https://github.com/babel/babel-preset-env#usebuiltins
Approach for untranspiled code (meant to be transpiled by Babel and, e.g., webpack):
- No package ever polyfills.
OlderNewer