Last active
December 20, 2015 02:09
-
-
Save KrystianP/6054362 to your computer and use it in GitHub Desktop.
basic js function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var per = function(imie, naziwsko){ | |
var person = {}; | |
Object.defineProperties(person, { | |
imie : { | |
value: imie, | |
}, | |
naziwsko : { | |
value: naziwsko , | |
writable: true, | |
enumerable : true | |
}, | |
fullName : { | |
get : function (){ | |
return this.imie + ' ' + this.naziwsko | |
}, | |
set : function (value){ | |
this.imie = value, | |
this.naziwsko = value | |
}, configurable : true | |
} | |
}); | |
return person; | |
} // end per | |
/*var person = (function (person){ | |
person.name = function(){ | |
return 'xxxxx'; | |
}; | |
Object.defineProperties(person, { | |
test : { | |
value : 'vvv', | |
writable : true | |
} | |
}); | |
return person; | |
}(person || {})); | |
var x = person; | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment