We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
type Move
MOVES
1 parent 3d56f2b commit 55739c1Copy full SHA for 55739c1
1 file changed
src/App.tsx
@@ -1,7 +1,7 @@
1
import React from "react";
2
3
-type Move = "rock" | "paper" | "scissors";
4
-const MOVES: readonly Move[] = ["rock", "paper", "scissors"];
+const MOVES = ["rock", "paper", "scissors"] as const;
+type Move = (typeof MOVES)[number];
5
6
function getRandomMove(): Move {
7
const index = Math.floor(Math.random() * 3);
0 commit comments