This question already has an answer here:
I have a simple if conditional like so,
if (gl.Node.moveUp.call(this) && this.parent._currentScene()) {
// Do something
}
Both functions return a boolean, does the condition get evaluated in order?
gl.Node.moveUp
alters something within the object calling it, which I would still like to happen even if _currentScene
returns false.
So in pseudo code if the condition output was something like
if (true && false) {
}
Would the call to gl.Node.moveUp
still get executed and alter the calling object or because the overall condition evaluates to false does javascript do a roll back?
Would it be better to wrap it into two if conditions like below?
if (gl.Node.moveUp.call(this)) {
if (this.parent._currentScene()) {
}
}