Skip to content

Instantly share code, notes, and snippets.

@rrameshbtech
Created July 30, 2018 03:54
Show Gist options
  • Save rrameshbtech/2969307d68ecad741e2e4e0b5d135473 to your computer and use it in GitHub Desktop.
Save rrameshbtech/2969307d68ecad741e2e4e0b5d135473 to your computer and use it in GitHub Desktop.
const City = function (cityName, knownFor) {
this.name = cityName;
this.speciality = knownFor;
this.print = function () {
console.log(`${this.name} is know for ${this.speciality}`);
};
};
const karur = new City('Karur', 'Textiles');
const coimbatore = new City('Coimbatore', 'Machineries');
karur.print(); // Karur is know for Textiles
coimbatore.print(); // Coimbatore is know for Machineries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment