# Javascript - Call, Apply, Bind
## Call method
This object _**profile**_ doesn't have a **method** _**setName**_ and we want to use the _**setName**_ in this profile object
```js
const profile = {
name: "John",
age: 24
};
const setName = function(name) {
return this.name = name;
};
```
We can use the **Call** method in **setName** function
```js
setName.call(profile, 'peter');
```
when we console.log() the profile object this is the result:
```js
console.log(profile); // {name: "peter", age: 20}
```
## Apply method
If we want to pass **multiple** parameters, or arrays, we can use the _**Apply**_ method
```js
const profile = {
name: "John",
age: 24
};
const setProfile = function(name, age) {
this.name = name;
this.age = age;
}
let params = ['peter', 30];
setProfile.apply(profile, params);
console.log(profile); // {name: "peter", age: 30}
```
## Bind method
An example of a loose method
```js
const profile = {
name: "Jonh",
getName() {
return this.name;
}
}
const getNameLoose = profile.getName;
console.log(getNameLoose()); // undefined
```
In order to find a method in an object, we may use the _**bind**_ method
```js
const profile = {
name: "John",
age: 24
};
const setProfile = function(name, age) {
this.name = name;
this.age = age;
}
const boundToProfile = setProfile.bind(profile);
console.dir(boundToProfile);
/*
...
[[TargetFunction]]: ƒ (name, age)
[[BoundThis]]: Object
age: 24
name: "John"
...
*/
```
It is as if the **setProfile** method is part of the object **profile**
```js
const profile = {
name: "John",
age: 24,
setProfile(name, age) {
this.name = name;
this.age = age;
}
};
```
And now we can call it like this
```js
boundProfile('george', 2);
console.log(profile); // {name: "george", age: 2}
```