snake(JavaScript)