chore(js): Don't use assignment expression value in control flow

It's very hard to tell whether it's intentional or a bug, so we avoid it.