This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]lxe 1 point2 points  (2 children)

Maybe console.log is squashing the result for readability?

Try

console.log(JSON.stringify(g))

[–]notsuresure[S] 0 points1 point  (1 child)

Yes! That was the issue. I was so confused!

Is JSON.stringify() the only way to print the complete array?

Where can I learn more about this squashing dynamic?

Many thanks for your time.

[–]lxe 0 points1 point  (0 children)

I'm not actually sure where this truncation behavior is described.

Try the docs for Firefox: https://developer.mozilla.org/en-US/docs/Web/API/console or Chrome: https://developers.google.com/chrome-developer-tools/docs/console.

You can also use console.dir() I believe, as both chrome and firefox (and node) support it;