Skip to content

Instantly share code, notes, and snippets.

@silent-lad
Created March 15, 2019 18:17
Show Gist options
  • Save silent-lad/fd4c31be6866781c8611c828febf04bc to your computer and use it in GitHub Desktop.
Save silent-lad/fd4c31be6866781c8611c828febf04bc to your computer and use it in GitHub Desktop.
function Preposition(name_init) {
this.name = name_init;
this.displayName = function() {
console.log(`Preposition is ${this.name}`);
}
}
let these = new Preposition("these");
these.displayName(); // Prints Preposition is these
let those = new Preposition("those");
those.displayName(); // Prints Preposition is those
these.displayName.call(those); // // Prints:- Preposition is those
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment