n = Number(n);
for (let i = 1; i <= n; i++) {
return i;
}
}
console.log(fromOneToN(5)); //Outputs only 1
The function returns 1 when called and not 1 2 3 4 5
Can someone help out?
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
n = Number(n);
for (let i = 1; i <= n; i++) {
return i;
}
}
console.log(fromOneToN(5)); //Outputs only 1
The function returns 1 when called and not 1 2 3 4 5
Can someone help out?