Javascript if (x==y==z): [duplicate]
问题 This question already has answers here : Double structural equality operators: if(a==b==c) (2 answers) Closed 6 years ago . I've got 3 random numbers (in this specific case between 1 and 7 but it doesn't really matter). I want to check whether I got "three of a kind" by using if (x==y==z) { code } The problem is that when x==y and z==1 x==y==z will return true. How do I check whether x, y and z actually got the SAME value? Example: 5==5==1 will return true, how do I check for 5==5==5