Basic JavaScript: Chaining If Else Statements Help

Tell us what’s happening:
Only getting error message:

// running tests
SyntaxError: unknown: Unexpected character ‘“’ (4:7)

2 | // Only change code below this line
3 | if (num < 5) {

4 | return “Tiny”
| ^
5 | } else if (num < 10) {
6 | return “Small”
7 | } else if (num < 15) {
Build failed

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”

// Only change code above this line
}

// Change this value to test
testSize(15);


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
}

// Change this value to test
testSize(15);

Your browser information:

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

Challenge: Chaining If Else Statements

Link to the challenge:

I changed the quotes but it didn’t help

what does it say now? what’s your new code?

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.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums

// running tests
SyntaxError: unknown: Unexpected token (19:0)

17 | // Change this value to test
18 | testSize(15);

19 |
| ^
Build failed

that’s not your whole code, it may be you are missing a bracket somewhere. I don’t know without seeing your code. check that all opening brackets have a closing bracket

not really sure what your talking about with backticks. I copied info from challenge to form that comes up when you click ask for help.

in your first post you had the code automatically included. now you changed your code. I don’t know what your code is. those are the instructions to add a formatted block code in your post so that you can show your new code.

still, my advice of last post is still valid, your brackets could be an issue.

<p>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
}

// Change this value to test
testSize(15); </p>

okay I think I understand about back ticks. below is my current code

<p> I figured it out. I will make sure to follow proper posting in the future. thank you for your  help <p>

the <p> is html, it’s just an example, it is not needed to format your code. also, you don’t need for regular text. Just for your code please.

and yes, the issue is your brackets. have you counted/checked them?

yes. I was able to correct and pass the challenge. Thank you for your help!