Advertisement
kthistlewood

Untitled

Oct 25th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Person(name) {
  2.   var _name = name;
  3.  
  4.   this.getName = function() {
  5.     return _name;
  6.   };
  7. }
  8. var person = new Person("Kyle");
  9.  
  10. person._name = "Hayden";
  11. window.alert(person._name);
  12. window.alert(person.getName());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement