Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement