Help in tic_tac game in isWin function

hello
so in building the game i have a function called isWin
to detect if the player win or not
and something strange happened
expression like this not working
if(arr[0]==arr[1]==arr[2]){do something}
in this array i change every index to the char when
player have move
and it store it correctly
i check that with alert(arr);
and if player click first 3 squares on game
arr[0]==arr[1]==arr[2]
but the if block not working
i try in the console
let arr=[“d”,“d”,“d”]
and work why this is not working
in the game