I am creating a function that adds the numbers within the parameters start to end to an array. I have kind of accomplished that but the function adds a few numbers beyond the end number. I have probably overcomplicated things here...
function range(start, end){
let numbersArray = [];
let counter = 0;
while(counter < end){
counter++
if (counter < end){
numbersArray.push(start++)}
};
return numbersArray
};
console.log(range(4, 11));
//[4, 5, 6, 7, 8, 9, 10, 11, 12, 13]