Why does the function run twice

I have a function at the top which makes a prompt. Its not supposed to run twice but it is running twice. Can someone look at my code please.
https://codepen.io/coderkoji/pen/dyNrjjq

Please I really need help on this and would appreciate it if someone just looked at my code

It doesn’t run twice, the function at the top runs once. Why do you think it runs twice? edit, sorry I though you were calling the second function as an alert as well

Also, you’re in a forum, you need to give it time. People will help, but you can’t just demand it – it could take a few hours before someone replies, you just need to be patient.

You called the function yourTurn twice, once in line number 28, and the other is in line 65 when you assigned it to the variable pTurn

1 Like

thx just figured it out

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.