| Level Navigation: 1 | 2 | 3 | (4ℹ️) | (5ℹ️) | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14⚡ | 15⚡ | (16ℹ️) | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26⚡ | 27⚡ | 28⚡ | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39⚡ | 40⚡ |
id to each new record (e.g., incrementing counter or crypto.randomUUID()).id with both reads and creates so future levels can reference it.itemsStorage).
import { randomUUID } from 'node:crypto';
const newItem = { ...req.body, id: randomUUID() };
itemsStorage.push(newItem);
res.status(201).json(newItem);