Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Person(first, last, age, gender, interests) {
- this.name = {
- 'first': first,
- 'last' : last
- };
- this.age = age;
- this.gender = gender;
- this.interests = interests;
- this.bio = function() {
- alert(this.name.first + ' ' + this.name.last + ' is ' + this.age + ' years old. He likes ' + this.interests[0] + ' and ' + this.interests[1] + '.');
- };
- this.greeting = function() {
- alert('Hi! I\'m ' + this.name.first + '.');
- };
- }
- var obj = new Person('apel', 'mahmud', 18,'male', 'Photography')
- console.log(obj.bio());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement