javascript call function

JavaScript
var person = {

  firstName:"John",

  lastName: "Doe",

    fullName: function () {

    return this.firstName + " " + this.lastName;

    }

}

	person.fullName();   // Will return "John Doe"
 var person = {

    fullName: function() {

    return this.firstName + " " + this.lastName;

    }
}

var person1 = {

  firstName:"John",

    lastName: "Doe"

  }

var person2 = {

  firstName:"Mary",

    lastName: "Doe"
}

	person.fullName.call(person1);  // Will return "John 
	Doe"
 
Source

Also in JavaScript: