Mid-Level
October 4, 2026Spot the bug: Vue.js / Nuxt.js
One snippet. Find the bug, or prove there isn't one.
typescript
1import { defineStore } from 'pinia'
2
3type OrderStatus = 'pending' | 'paid' | 'shipped' | 'cancelled'
4
5export const useOrderStore = defineStore('order', {
6 actions: {
7 getStatusLabel(status: OrderStatus): string {
8 switch (status) {
9 case 'pending':
10 return 'En attente'
11 case 'paid':
12 case 'shipped':
13 return 'Payée'
14 case 'cancelled':
15 return 'Annulée'
16 default:
17 return 'Inconnu'
18 }
19 },
20 },
21})Click the lines that carry the problem.
Your verdict
One attempt per day. The answer shows up right after.
Keep your streak
Create an account to keep your streak and track your progress.