Help me please! I've watched the video and did the same thing but it still doesn't work

Tell us what’s happening:
Describe your issue in detail here.

   **Your code so far**

function testSize(num) {
 // Only change code below this line
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"
}
}
 return "Change Me";
 // Only change code above this line
}

testSize(7);
   **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36

Challenge: Chaining If Else Statements

Link to the challenge:

You should be seeing an syntax error in the console pane below the editor. That is telling you that you have a typo. Make sure all of your curly brackets line up properly. Once you fix that it will pass.

2 Likes

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

1 Like

I can’t fix the TypeError: Cannot read properties of undefined (reading ‘actual’)

Allow me to repeat myself:

“Make sure all of your curly brackets line up properly.”

In other words, make sure you have the same number of left curlies and right curlies.

2 Likes

I did as you said but it still doesn’t work

What is your updated code?

1 Like

What is your new code?
Can you show us that?

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 (’).

3 Likes
function testSize(num) {
  // Only change code below this line
   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"
  }
} 
  // Only change code above this line

And what error messages are you getting?

1 Like

I am able to pass with your code
Can you tell us what error messages you are getting?

2 Likes

It was TypeError: Cannot read properties of undefined (reading ‘actual’)
But I fixed it and I have no idea how did I fixed it. Anyway, thank you.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.