Interpolate a template string with parameters.
Replaces {variableName} placeholders with values from the params object. Unmatched placeholders are preserved as-is.
{variableName}
The template string with {variable} placeholders
{variable}
The parameters to interpolate
The interpolated string
interpolate("Hello {name}!", { name: "World" })// "Hello World!" Copy
interpolate("Hello {name}!", { name: "World" })// "Hello World!"
Interpolate a template string with parameters.
Replaces
{variableName}placeholders with values from the params object. Unmatched placeholders are preserved as-is.