+ 2
Why doesnt my "IF" statement work
I'm writing a code to give a scientific notation of a number and I noticed the if statement isn't doing what it said https://code.sololearn.com/Wo6qbx2iPIpW/?ref=app https://code.sololearn.com/Wo6qbx2iPIpW/?ref=app
12 Respuestas
+ 3
Your program will evaluate input/10 but won't know what to do with this number. You need to set input equal to this value or it will just be ignored.
Eg. input = input/10
+ 5
The statement input / 10; doesn't do anything, you probably want to use input /= 10 (same with input * 10)
+ 4
It doesn't. Unless you use something like return input / 10. A single statement "input / 10" will never have any effect
+ 3
but why
+ 3
Michael Okolie You mean the x+=1?
+ 2
but it works in functions
+ 1
Remember Javascript is case sensitive
0
Frenchtoast
No the "If" statement
0
Michael Okolie I am confused as to what you are asking? "If" statements work in functions.
0
am saying that
" input / 10"
didn't work in my if statement but it works in functions Frenchtoast
0
Give me an example please.
0
use "if" not "IF"..case sensitive