Skip to main content

Function borrowing and currying

Function borrowing…..

var person = {
	firstName : "atik",
	lastName : 'haque'
	getName : function (){
		return this.fristName + "" + this.lastName;
	}
}

var newPerson = {
	firstName : 'kamal',
	lastName : 'khan' 
}

person.getName.call(newPerson);

Function currying…..

function MultipleBy(a,b) {
	return a * b;
}

var multipleByThree = MultipleBy.bind(this,3);
multipleByThree(5);

Leave a Reply

Your email address will not be published. Required fields are marked *