What does this version selector print?

from API versioning
Node 24 beginner 2 min

What does this version selector print?

JavaScript
function resolve(path) {
  const match = /^\/api\/(v1|v2)\//.exec(path);
  return match ? match[1] : "unsupported";
}

console.log(resolve("/api/v2/orders"));
console.log(resolve("/api/v3/orders"));
Open in playground
Report an error