Your error is in the second part of the conditional. You have to use double ==
to make it work:
if (edad2 == 30 || estatura == 1.60){ document.write("true")("true");} else { document.write("true")("false");}
Only one =
is used for assignment.
On the other hand, if you are going to do a double assignment in the same line you have to separate them by ;
:
> var estatura = 1.70; var edad2 = 30;
> estatura
1.7
> edad2
30
Or, failing that, use a ,
to separate the expressions:
> var estatura = 1.70, var edad2 = 30;
> estatura
1.7
> edad2
30
Both work.
If you are testing code in the browser console (the easiest way to practice it), then you can use multiline by pressing Shift + Enter , that way it looks more ordered and you can practice better without breaking your head reading everything in the same line:
> var estatura = 1.70; var edad2 = 30;
> if( edad2 == 30 || estatura == 1.60){ // Shift + Enter
console.log("true"); // Shift + Enter
} else { // Shift + Enter
console.log("false"); // Shift + Enter
} // Enter
true
>