If statements help

Hey guys can anyone help me with creating a program that gives the lowest number back to the user. This is what i’ve done so far but still sort of struggling.

What issues are you having, exactly? Any error messages?

1 Like

just dosen’t appear if you enter lower numbers on number2 variable. Only the first statement is active when you run the program.

I wanna try and run it on my end to see what’s going on. How are you running it? Terminal? IDE?

Sure thing. Running on atom text editor.

Take a closer look at the if-else if-else conditions. There’s typo in the first one, but there’s other reason why you might be seeing incorrect results.

I don’t see the type errors can you point it out with my screenshot

But like I said, there’s also other reason why it’s not working correctly.

let’s say that he numbers are

number1 = 2
number2 = 3
number3 = 1

I suggest you play a bit just with the numbers and console log
statements to see which one of your if statements execute

like this:

console.log(number1 < number2) // true
console.log(number1 < number3) // false
console.log(number1 < number2 || number1 < number3) // true

find out why this return true even if it is not the desired result, fix it and the syntax errors and you are maybe good to go

You were right about the typo error. Thanks for the help :smile:

however the third statement ain’t working.