First the really easy advice: + use strict mode https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode + use `const` instead of `let` for stuff you know you're not supposed to change (symbol, player1, player2); declaring it const helps you keep some assumptions later + use `===` instead of `==` generally; I think the only legitimate use for `==` is for using it with `null` when you allow undefined or results of `typeof` if you feel like you're a JS human minifier :) + use better naming in general and prefer camel case since JS already does it and it would look weird to have two casing strategies in the same codebase; I'm also talking about _array_ in `function checkforOwin(array)` - _array_ is extremely generic (what array?!?) I would call it _board_ so I know what I'm dealing with; the fact that it's implemented as an array is a detail; I'd also like a function named like that to just check and return true/false than exit the process xD ...and the more involved: + I would use nested arrays for the board because I can't easily picture what `board[7]` is; but I can picture what `board[2][1]` is + those really long if statements look very repetitive; they look a lot like patterns on a board so instead let's turn that code into data so we can manage it easier; we can rewrite the patterns like this: <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> const isOWinner = [ [0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 4, 8], // ... ].some((indices) => indices.every((index) => board[index] === player1)) <!-- end snippet --> That big condition blob in your if statements can be rewritten like this. Because it's an array you can store it somewhere; load it; merge with other patterns or extend or whatever you can do with arrays. Code that looks like data should be represented as data