---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/util.bind.md
  - https://yandex.com/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/util.bind.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/jsapi-v2-1/doc/en/llms.txt

# util.bind

{% note alert %}

This function is deprecated. Use native Function.bind method.

{% endnote %}

Static function.

Binds the passed function to the passed context.

**Returns** a copy of the given function with the specified `this` value.

```javascript
{ Function } util.bind(callback, context)
```

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`callback`](#param-callback)[*](*star) | — | Type: Function

Function. ||
|| [`context`](#param-context)[*](*star) | — | Type: Object

Execution context. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
var myObject = {
    name: 'test!'
};
ymaps.geocode.load('Moscow')
    then(ymaps.util.bind(function (res) {
        alert(this.name); // test!
    }, myObject));
```

[*star]: Mandatory parameter/option.