Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- function Person(){
- this.username = new Array();
- this.password = "xero2010";
- }
- Person.prototype.getInfo = function getInfo(){
- document.write(this.username+","+this.password);
- }
- var person1 = new Person();
- var person2 = new Person();
- //不共享属性,互不影响
- person1.username.push("Wilson");
- person2.username.push("Alex");
- person1.getInfo();
- person2.getInfo();
- </script>
Add Comment
Please, Sign In to add comment