Hey,
ich habe eine if-else Abfrage in der ich prüfe ob X ungleich Element ist.
Nun ist es so, dass wenn ich mit !== prüfe trotzdem die Bedingung erfüllt ist obwohl X ungleich Element ist.
Folgender Code betrifft es
JavaScript
if(choosenProductoptions[productoptions] !== "Quantum1500" || choosenProductoptions[productoptions] !== "Quantum1800"){
TweenMax.to( object.material._albedoColor, 1, {
r : this.colors[choosenProductoptions[productoptions]].r,
g : this.colors[choosenProductoptions[productoptions]].g,
b : this.colors[choosenProductoptions[productoptions]].b
})
}else{
console.log("detected")
}
Nun wenn ich einfach anders rum mit === prüfe und die IF-Abfrage etwas verändere, wird plötzlich in den else gesprungen was für mich das normale Verhalten darstellt.
JavaScript
if(choosenProductoptions[productoptions] === "Quantum1500" || choosenProductoptions[productoptions] === "Quantum1800"){
}else{
TweenMax.to( object.material._albedoColor, 1, {
r : this.colors[choosenProductoptions[productoptions]].r,
g : this.colors[choosenProductoptions[productoptions]].g,
b : this.colors[choosenProductoptions[productoptions]].b
})
}
Warum ist das denn so? Hat jemand eine Idee?