Mqx
Mqx16mo ago

Deno console.log() all items of array

Hey how can I enable all of the output, so that Deno does not cut of items?
No description
6 Replies
Mqx
MqxOP16mo ago
Is there a flag to enable this?
/|\  /|\
/|\ /|\16mo ago
I would loop over the array and then print all the values 1 by 1
GoemoN
GoemoN16mo ago
If you only need to get a look of what it prints out, I suggest you to stringify the whole content and gave it a bit of spacing like this: JSON.stringify(arrayToShow, null, 2)
/|\  /|\
/|\ /|\16mo ago
If there is really not enough space to print it all, try to print it to a file
SyrupThinker
SyrupThinker16mo ago
To get the exact formatting you can use Deno.inspect with some options (https://deno.land/api@v1.36.2?s=Deno.InspectOptions)
console.log(
Deno.inspect(
longArray,
{ colors: true, iterableLimit: Infinity }
)
)
console.log(
Deno.inspect(
longArray,
{ colors: true, iterableLimit: Infinity }
)
)
Deno
Deno.InspectOptions | Runtime APIs | Deno
Option which can be specified when performing {@linkcode Deno.inspect}.
Mqx
MqxOP16mo ago
This is what I was looking for! Thanks!