JavaScript String.Replace: Replacement Pattern for Full Match Reminder

This is my quick reminder to self to use
instead of
in JavaScript for Regular Expression replacement patterns when wishing to use the entire matched text.

Some browsers allow $0, but $& is officially documented (table 22, page 147) and supposed to work in all of them.

document.write("Hello World".replace(/^Hello/, "$& to the whole");

Hello to the whole World