fix: update JOKES example to use the array's length (#337)
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user