There's no Object.prototype.toArray, nor can you spread an object, because it's not an iterable - but you can use Object.keys/entries/values, and iterate over that array.
On Sat, Dec 10, 2016 at 6:40 PM, Michael Theriot < [email protected]> wrote: > (FYI this was tagged spam by Gmail for failing email auth) > > You can't do that, but this will probably achieve what you wanted. > > `var obj = Object.assign({}, new Array(4).fill(1));` > > I think a few of these already exist under a different name. > > Object.prototype.parent -> Object.prototype.constructor > Object.prototype.toArray -> [...Object] > Array.prototype.iterate -> Array.prototype[Symbol.iterator] > Entity() -> Object.create(null) > > On Wed, Dec 7, 2016 at 9:08 AM, Michelle Antonello < > [email protected]> wrote: > >> How well does JavaScript model constructs in Graph theory ? >> >> obj = { >> [0,1,2,3]:1 >> } >> >> Also, I would like >> >> Object.prototype.parent >> Object.prototype.forEachOwnProperty >> Object.prototype.trace >> Object.prototype.traceModules (emits source) >> Object.prototype.toArray >> Array.prototype.iterate = { (iterator function_) } >> Entity() (A lightweight Object superclass w/o an *.prototyp property) >> Even more powerful regular expressions !!! >> >> I monitor progress in mathematics and physics (eg. Black holes accurately >> modeled by tensors == Array.prototype construct; Discovery of Higgs >> particle as sole mass carrier == Object baseclass along with its extensible >> prototypes) >> >> Michelle Antonello >> Abdul S. >> _______________________________________________ >> es-discuss mailing list >> [email protected] >> https://mail.mozilla.org/listinfo/es-discuss >> > > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

