Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

apply call in bind method()

var car = {
    registrationNumber: "FT5142",
    brand: "Benz",
}

  function displayDetails(ownerName){
        console.log(ownerName + ", this is your car: " + this.registrationNumber+ " " + this.brand );
    }
// car.displayDetails();


displayDetails.apply( car, ["Raymund"]);

displayDetails.call(car, "Raymund");
 
PREVIOUS NEXT
Tagged: #apply #call #bind
ADD COMMENT
Topic
Name
1+2 =