I have to do a function to return an array with all positive numbers from 0 to n (inclusive, meaning n should be included in the array and n will be a number passed to the function as parameter.
This is what i have:
function arrayWithNumbersUpTo(n) {
for(var i = 0; i <= n; i++) {
arr.push(i);
return arr;
}
}
var arr = [];
I've been struggling for over two hours to do what I am sure is a simple solution, please help!