Help with Tic-Tac-Toe?

https://codepen.io/rstorms/pen/qYvZBY?editors=0010

I have no idea how to make the alert pop up that anyone has won, nor have I figured out how the computer to make its move. I know it’s definitely not my best code, but I figured I can clean it up later once I understand the logic.

Quite honestly, I don’t even know how to do that. Using safari, too.