You are using an inadequate resource. One of the things that few people understand is that there is the data and there is the textual representation of the data. JS, like other languages, have a function toString()
that delivers the textual representation of the object. When you have a die printed it takes this textual representation. I have already said in details about this.
It turns out that the textual representation is not always suitable to show to the application user. This works well with scalar values, which are the simple data often considered primitive. When the data is composed it becomes more complicated to define how the textual representation of it should be and in each situation may need to represent it in a different way, so for composite data the standard textual representation provided only serves for debugging purposes. It is not the end of the world to use it to present to the user if it is exactly what you want, but in case it is not, then the solution is to assemble the presentation the way you want.
The question does not speak explicitly but it seemed clear to me that I wanted the values to be presented one by one in a row, probably separated by comma and so I give the solution below.
It has several forms, one of them is using the join()
.
let array7 = new Array;
for (let x = 0; x < 50; x++) array7[x] = Math.floor(Math.random() * 50 - 10 + 10);
let array8 = array7.filter(array7 => array7 < 20)
console.log(array7.join(", "));
console.log(array8.join(", "));
I put in the Github for future reference.
where you made that exit like this?
– novic
This is who did it. There is no code that solves.
– bfavaretto