So whenever I post my Javascript code to the forum I get told my code is formatted badly. Which confuses me because I swore I formatted it correctly on the lesson.
I’ve realised that when you click ‘ask for help’ and let that automatically post your code, the spacing added vanishes.
This,
function rangeOfNumbers(startNum, endNum) {
if (startNum == endNum){
return endNum;
} else {
const arrNum = rangeOfNumbers ();
arrNum.push();
return arrNum;
}
};
console.log(rangeOfNumbers(1, 5))
Ends up as this
function rangeOfNumbers(startNum, endNum) {
if (startNum == endNum){
return endNum;
} else {
const arrNum = rangeOfNumbers ();
arrNum.push();
return arrNum;
}
};
console.log(rangeOfNumbers(1, 5))
Ignore my bad code, it is just to demonstrate the issue.