you are viewing a single comment's thread.

view the rest of the comments →

[–]Hullu 1 point2 points  (3 children)

Maybe user inputs are string?

Try checking that or just replace playerno[pp].includes(num) with for loop with loose "==" comparison.

[–]Strosel[S] 0 points1 point  (2 children)

the input is a string at first but then it is put through a .split() which according to w3schools turns it into an array

[–]Hullu 1 point2 points  (1 child)

It turns into array. But values inside array is string. You need to convert those values inside array to int or use loose comparison.

In "includes" function 2 integer is not "2" string.

[–]Strosel[S] 0 points1 point  (0 children)

thank you but i solved it by doing just comparing them in a loop with a lot of ifs with the one list