fix: update JOKES example to use the array's length (#337)

This commit is contained in:
omar2205
2022-07-01 01:40:05 +02:00
committed by GitHub
parent 8d118a2d30
commit 3569e645a5
+1 -1
View File
@@ -211,7 +211,7 @@ const JOKES = [
];
export const handler = (_req: Request, _ctx: HandlerContext): Response => {
const randomIndex = Math.floor(Math.random() * 10);
const randomIndex = Math.floor(Math.random() * JOKES.length);
const body = JOKES[randomIndex];
return new Response(body);
};