What would be the result of this?

-3

I need to know how to get the value of x after executing this variable:

x=1; 
if(x<1)
{
  x=2;
}else if (x>=1)
 {
   x=0;
 }else{
   x=3
  }
    
asked by Hannah 11.11.2018 в 04:22
source

1 answer

0

I have not noticed that your question belonged to javascript

Option 1

alert("Resultado de la variable:"+ x);

Option 2

document.getElementById("variable").innerHTML = x;
<p id="variable"></p>

Option 3

console.log(x);
    
answered by 11.11.2018 в 05:20