You are viewing a single comment's thread. Return to all comments →
why my test case was faild
function addNumbers(n) { if(n % 2 !== 0) { console.log("weird")
} else { if (n >= 2 && n <= 5) { console.log("not weird") } else if(n >= 6 && n <= 20) { console.log("Weird") } else if(n > 20) { console.log("Not Weird") } } }
addNumbers(3)
Seems like cookies are disabled on this browser, please enable them to open this website
Day 3: Intro to Conditional Statements
You are viewing a single comment's thread. Return to all comments →
why my test case was faild
function addNumbers(n) { if(n % 2 !== 0) { console.log("weird")
} else { if (n >= 2 && n <= 5) { console.log("not weird") } else if(n >= 6 && n <= 20) { console.log("Weird") } else if(n > 20) { console.log("Not Weird") } } }
addNumbers(3)