2

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?

mxcdh
  • 805
  • 3
  • 10
  • 20

1 Answers1

0

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.

eogabor
  • 242
  • 4
  • 14
  • Thank you, but I have still [], screenshot: https://i.imgur.com/eQv6PUj.png btw I using .ts files. – mxcdh May 25 '22 at 11:48
  • No, please look at the diffrent example: https://i.imgur.com/CtIgfSo.png ts-node return correct reuslt, but qukka, empty [], what is wrong? – mxcdh May 25 '22 at 11:53
  • It seems like you want to view the variable value in a function, with an input parameter. Because the input parameter could vary, i dont think that you can view the value of a variable in the scope of the function with quokka. You could view the result like this: let a = solution(inputArr); a; – eogabor May 25 '22 at 11:58
  • Or imagine what should Quokka display, if you call your function multiple times... Its not possible to display data inside the function scope. – eogabor May 25 '22 at 12:04