Javascript: Conway's game of life

<!DOCTYPE html>

<html lang="en">

<head>
   <title>Conway's Game of Life</title>
</head>

<body>

    <style>
        canvas {
  box-sizing: border-box;
  border: 10px solid #000;
  width: 800px;
  height: 800px;
}
    </style>

    <canvas id = "canvas" width = "800" height = "800" ></canvas>
</body>


<script>

var c = document.getElementById("canvas");
var ctx = c.getContext("2d");

const width = 100
const height = 100

let array = []

initializeBoard = () => {
    for (let x = 0; x < width; x++) {
      array[x] = [];
      for (let y = 0; y < height; y++) {
        array[x] [y] = Math.random() < 0.5
      }
    }
}  
initializeBoard()

function drawBoard () {
    for (let x=0; x< array.length; x++) {
        for (let y=0; y< array[x].length; y++) {
            if (array[x][y] == true) {
                ctx.beginPath();  
                ctx.rect(x*10, y*10, 10, 10);  
                ctx.fillStyle = "green";  
                ctx.fill();

            }else{
                ctx.beginPath();  
                ctx.rect(x*10, y*10, 10, 10);  
                ctx.fillStyle = "red";  
                ctx.fill();  
            }
        }
    }
}

drawBoard()

function updateBoard () {

    
}



</script>
</html>



Hello, I am trying to create Conway’s game of life using javascript and html. As you can see in my code i have made the randomization of the cells. I now want to implement the rules of the game and animation. However i am stuck and don’t quite know how to approach this step. Anybody got any idea of how I could get started or how it may be solved?