> For the complete documentation index, see [llms.txt](https://wrapper.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wrapper.angular-package.dev/wrap/methods/instance/valueof.md).

# valueOf()

## `Wrap.prototype.valueOf()`

Returns the [wrap](/getting-started/basic-concepts.md#wrap), [primitive value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf) of a specified [`Wrap`](/wrap/overview.md) object.

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf>" %}

{% code title="wrap.class.ts" %}

```typescript
public valueOf(): `${Opening}${Text}${Closing}` {
  return super.valueOf() as `${Opening}${Text}${Closing}`;
}
```

{% endcode %}

### Return type

#### `${Opening}${Text}${Closing}`

The **return type** is the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) of generic type variables in order [`Opening`](/wrap/generic-type-variables.md#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrap/methods/instance/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than) and [`Closing`](/wrap/generic-type-variables.md#wrap-closing).

### Returns

The **return value** is the wrap of generic type variables in order [`Opening`](/wrap/generic-type-variables.md#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrap/methods/instance/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than), and [`Closing`](/wrap/generic-type-variables.md#wrap-closing) on the template.

## Example usage

```typescript
// Example usage.
import { Wrap } from '@angular-package/wrapper';

// Returns [quote] of type "[quote]".
new Wrap(`[`, `]`, 'quote').valueOf();
```
