[Solved] Javascript program is not recognizing an if statement [duplicate]


Since playerSelections and colorSequence are arrays, your the condition gameObject.playerSelections === gameObject.colorSequence tests that the array references are equal, not the contents of the arrays.

You need to check that each element of the array is equal:

How to check identical array in most efficient way?

1

solved Javascript program is not recognizing an if statement [duplicate]