In JavaScript and in all programming languages I know, boolean logic operators don't combine in that way, they follow a fixed bool OPERATOR bool
schema.
This means that your series of parenthesised ||
is first incrementally converted to one single value, and that value is then compared with your choice
.
The easiest way to achieve the logic you want is by harnessing Array#every to repeat your logical operation on each of your values until the operation fails:
['A1', 'A2', 'A3', 'A4'].every(function(x) { x != choice })
Which translates to: 'choice' must be different from every value in 'array'
.
In general everytime you need to repeat something, think about how you could do it with arrays and their iterator methods, it's often the most elegant way.