The Map constructor takes an iterable of [key, value] pairs. Array.from
takes an iterable of elements.This asymmetry is presumably because the
Array constructor's behaviour is already defined. A hypothetical Map.from
would merely be the same as the Map constructor!
Not quite true: Array.from,
The other motivation might be subclasses - MyArray.from creates a MyArray,
MyMap.from would create a MyMap.
On Tue, Apr 14, 2015 at 2:03 AM, Leon Arnott leonarn...@gmail.com wrote:
The Map constructor takes an iterable of [key, value] pairs. Array.from
takes an iterable of elements.This
In Node.js you can either mention the file extension .js or omit it when you
require a module. Which one is preferred for ES6 ModuleSpecifiers?
Thanks!
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
rauschma.de
___
es-discuss mailing list
Some food for thought from a non-standard use-case.
In GPSEE, we can require(module) - but we support both modules written in
JavaScript, and modules written in C (technically, any compiled binary with
the correct C API), or both. We dlload(module.so) (if present), then
interpret module.js (if
4 matches
Mail list logo