I happen to be working with javascript and I have had to do this.
let ejemplo = "si";
if (ejemplo == "si") {
//realiza 'x'
} else {
//realiza 'y'
}
So far so good, if my variable ejemplo
has the value "if" only performs 'x' and if it has a different value of "if" performs 'and'.
But when I make this change it does not happen the same
let ejemplo = "si";
if (ejemplo != "si") {
//realiza 'x'
} else {
//realiza 'y'
}
Any value that I give to ejemplo
only performs 'x', in theory if I give "yes", I should do 'and', but that does not happen.
Any ideas?