Game of life written on javascript