+ 2
What's Wrong?
i made a code with if but it shows error on the else if https://code.sololearn.com/WIGQQ4y0k30i/?ref=app
3 ответов
+ 17
if (orange === C1)
{
iva = C1;
document.write(price + iva);
}
else if (orange === C2)
{
iva = C2;
document.write(price + iva );
}
else if (orange === C3)
{
iva = C3;
document.write(price + iva );
}
else {
document.write("Nothing Found");
}
Semicolon are incorrect, replace with this.
Bye.
+ 1
That 'var tot' you declared is a Native variable, meaning it can't simply change its value automatically when you call it back inside that 'if else' conditional expression.
0
try this
var o = [.1,.25,.5];
var i=0;
document.write((o[i]+1)*price );