## Template Literals

Template literals are an extension of string notation introduced in ES6 (ECMAScript 2015) that allows strings to be enclosed in backticks (`).

### String Interpolation

With template literals, you can insert variables into strings using the `${variable}` syntax.

```javascript
const name = 'Alice'
const greeting = `Hello, ${name}!`
console.log(greeting) // Output: Hello, Alice!
```

### Variables that can be used in tasks include 'data', 'variables', and 'domain'.

- data
  - Contextual data for the scenario containing the task (step), maintaining the names and execution results of each step as attributes with key-value pairs in the scenario instance.
- variables
  - Contextual data for the scenario containing the task (step), maintaining the names and values of parameters passed when the scenario instance starts as attributes with key-value pairs.
- domain
  - Contextual data for the scenario containing the task (step), holding information about the tenancy in which this task is executed.

```
// Example of using template literals to construct a URL path.
https://abc.com:8000/fetch-tools?search=${variables.search}
```

```
// Example of using template literals to construct a logging string.
result code: ${data.result.code}
```

```
// Example of using template literals to construct a GraphQL query.
query {
  fetchTools(search="${variables.search}") {
    items {
      id
      name
    }
  }
}
```
