function count(param1, param2) {
let value = [];
for (let i = param1; i <= param2; i++) {
value.push(i);
}
return value;
}
let countNumber = count(0, 10);
console.log(countNumber);
I want to show it as a string like 0,1,2,3,4,5. But I can’t solve this problem. I can only solve this as an array. My output is [0,1,2,3,4,5].
>Solution :
try
console.log(countNumber.toString());
ref : https://www.w3schools.com/jsref/jsref_tostring_array.asp