Conway's game of Life (or just Life) in 5 minutes

About

Conway's game of Life (or as it sometimes called - Life) can be considered as life simulation.
The rules for the game were developed in 1970-s and are very simple:

In essence - this is a zero-player game which flow is determined only by initial position.
However you never know how the game will evolve after several iterations.

Link to Wikipedia: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

Live coding

Here is a live coding session that shows how it can be done.

Duration: 4:54

Sources: https://github.com/5minute/examples/tree/main/conway_life

See live results:https://jsfiddle.net/9sycwv48/

Disclaimer: never use this code in production. It was created for fun.