Conway's game of life implementation in JS