What does this bounded context selector print?

from Agent context management
Node 24 beginner 3 min

What does this bounded context selector print?

JavaScript
const candidates = [
  { path: "README.md", priority: 5 },
  { path: "src/cart.js", priority: 2 },
  { path: "AGENTS.md", priority: 0 },
  { path: "tests/cart.test.js", priority: 1 },
];

const selected = candidates
  .sort((left, right) => left.priority - right.priority)
  .slice(0, 3)
  .map((item) => item.path);

console.log(selected.join(" -> "));
Open in playground
Report an error