Tell us what’s happening:
hey guys why my function doesn’t work? the || is wrong to connect both boolean?
Your code so far
function rangeOfNumbers(startNum, endNum) {
if ( n < 1){
return []
}
else{
const arr = x(n - 1)
arr.unshift(startNum) || arr.push(endNum)
return arr
}
};
console.log(1,4)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 OPR/100.0.0.0
Challenge: Basic JavaScript - Use Recursion to Create a Range of Numbers
Link to the challenge: