Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var User = function(id, name, pass) {
- var Obj = new Object(); // veya var Obj = {};
- Obj.id = id;
- Obj.name = name;
- Obj.pass = pass;
- Obj.write = function(x) {
- document.write(this[x]);
- return this;
- };
- Obj.str = "";
- Obj.serialize = function() {
- this.str = "{\"id:\""+ this.id +", \"name\":\""+ this.name +"\", \"pass\":\""+ this.pass +"\"}";
- return this;
- };
- Obj.out = function() {
- document.write(this.str);
- return this;
- };
- return Obj;
- }
- var user = User(1, "Kerem", "shG9011");
- user.serialize().out().write("name");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement