Created
July 30, 2018 01:34
-
-
Save rrameshbtech/2fca286e439f1812a914b40d2ad01f44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printSpeciality() { | |
console.log(`${this.city} is know for ${this.speciality}`); | |
} | |
const printKarurSpeciality = printSpeciality.bind({city: 'Karur', speciality: 'Textile Industries'}); | |
printKarurSpeciality(); // Karur is know for Textile Industries | |
const printCoimbatoreSpeciality = printSpeciality.bind({city: 'Coimbatore', speciality: 'Mechanical Industries'}); | |
printCoimbatoreSpeciality(); // Coimbatore is know for Mechanical Industries | |
const printTirupurSpeciality = printCoimbatoreSpeciality.bind({ | |
city: 'Tirupur', | |
speciality: 'Textile Industries' | |
}); // Already bound function can not be overridden | |
printTirupurSpeciality(); // Coimbatore is know for Mechanical Industries |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment