Why Quokka not showed [...Array]?

255 Views Asked by At

I have problem, that Quokka not showed result for this line:

[...Array(max - min + 1).keys()].map(i => i + min);

Below screenshot: enter image description here What is wrong, and how I can fix it?

1

There are 1 best solutions below

4
On

You should give a variable the result of the function as value, then reference it, like this:

const range = (min, max) =>
  [...Array(max - min + 1).keys()].map((i) => i + min);
let a = range(1, 5);
a;


This way it displays the result:

enter image description here

Calculating the value of it wont display the result by default.