Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function User(username, password) {
- Object.defineProperties(this, {
- id: {
- get: function() {
- return 1;
- },
- enumerable: true
- },
- username: {
- get: function() {
- return username;
- },
- enumerable: true
- },
- password: {
- get: function() {
- return password;
- }
- }
- });
- }
- var pippo = new User('pippo', 123456);
- var pluto = new User('pluto', 'ciao!11');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement