[[+content_image]]
B
B
Banan442020-05-19 21:21:06
Node.js
Banan44, 2020-05-19 21:21:06

How to configure the display of arrays in the console (or alternative compiler plugin)?

Let's say there is a large matrix that needs to be rendered to the screen (for checks, etc.)

maze = [[1,1,1,1,1,1,1],
             [1,0,0,0,0,0,3],
             [1,0,1,0,1,0,1],
             [0,0,1,0,0,0,1],
             [1,0,1,0,1,0,1],
             [1,0,0,0,0,0,1],
             [1,2,1,0,1,0,1]]
console.log(return maze)

I expect to see something like this in the console (* whatever):
[*, *, *, *, *, *, *, *, *],
[*, *, *, *, *, *, * , *, *],
[*, *, *, *, *, *, *, *, *],
...
But I get:
[
*, *, *, *, *,
*, *, *, *
],
[
*, *, *, *, *,
*, *, *, *
],
[
*, *, *, *, *,
*, *, *, *
],
...

Agree, read such a matrix (in my case it is in the form of a maze) is simply impossible, of course I understand that they did it so that it would be convenient to read other data, but it bothers me.
Is there a way to display data as I wrote above? Without any additional cycles. Perhaps there is another Javascript compiler outside of the browser? If there is any, tell me (I would also really like to have such a compiler inside sublime, I know that it is there without input, tell me where)

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Alexander Taratin, 2020-05-21
@Taraflex

https://www.npmjs.com/package/as-table

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question