appendVariable

fun appendVariable(name: String, defaultValue: JsAny): SnippetString(source)

Builder-function that appends a variable (${VAR}) to the {@linkcode SnippetString.value value} of this snippet string.

Parameters

name

The name of the variable - excluding the $.

defaultValue

The default value which is used when the variable name cannot be resolved - either a string or a function with which a nested snippet can be created.