Cellular automata is a discrete model commonly used in computer science. A logical grid of cells, each containing a finite number of states. In my example, I only use two possible states: "alive" or "dead". The current state of each cell is exclusively dependent it's neighboring cell's current state.
The states are updated on each 'step', In my case, for every step, if the 'neighbor count' was greater than X, the cell lived (changed state from 0 to 1, or stayed 1). Else, the cell is/stays "dead"/0. It is possible to generate very organic/natural looking procedural tile-maps.
With my implementation I started by initializing a 2D array (or in JavaScript's case, an array of arrays...), and filling this 2D array with a variable fill percentage. This resulting grid of varying 1s and 0s is then passed to a variable number of cellular automata generation steps. For each generation step, the 2D grid is 'scanned' or looped over each individual cell's state, and determined (based on a set rule) each individual cell's resulting state. Which is then, determined if the resulting grid should again, passed to another generation step, or returned as a result.