game of life in javascript