Call, Bind and Apply

JS OOPS

by manoj_antony32

JavaScript

var obj1 = { num: 3 };

var testFunction = function(a, b, c){
		return this.num + a + b + c;
};
var arr = [2, 4, 5];
//testFunction.call(obj1, 2);
//testFunction.apply(obj1, arr);

var gound = testFunction.bind(obj1);

console.log(gound(2,3,1))