What does this global search print?

from Regular expressions
Node 24 beginner 3 min

What does this global search print?

JavaScript
const input = "A12 B345";
const digits = /\d+/g;
const found = [...input.matchAll(digits)]
  .map((match) => `${match[0]}@${match.index}`)
  .join(", ");

console.log(found);
Open in playground
Report an error