please what are my missing on my code. i have cross checked i cant find my mistake
**Your code so far**
function testSize(num) {
if (num < 5) {
return "Tiny"
} else if (num < 10) {
return "Small"
} else if (num < 15) {
return "Medium"
} else if (num < 20) {
return "Large"
} else {
return "Huge"
}
}
console.log(textSize (19));
/*Write chained if/else if statements to fulfill the following conditions:
num < 5 - return Tiny
num < 10 - return Small
num < 15 - return Medium
num < 20 - return Large
num >= 20 - return Huge
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Edg/92.0.902.78
Challenge: Chaining If Else Statements
Link to the challenge:
columbuschidozie1:
textSize (19)
This is a typo. That could be your problem.
i have corrected it,nothing changed
You have defined a function testSize
but you are calling the function textSize
which is not defined in your code.
i have changed it to test, still the same
I just checked your code and it worked fine for me after fixing this line of code:
console.log(textSize (19));
could it be computer error???
Can you share your updated code here?
Here is how to write code in the forum.
When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor ( </>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).
system
Closed
February 22, 2022, 8:48am
9
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.