Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Answers
Here i am getting output as undefined, please tell me why
Minhaj Hussain
6y
161
1
Reply
<script type="text/javascript">
function Employee() {
this.Name="Minhaj"
var getName = function() {
return this.Name;
}
this.PrivGetName=function () {
return getName();
}
Employee.prototype.Publicget=function () {
return this.PrivGetName();
}
}
var obj=new Employee();
alert(obj.Publicget());
//OUTPUT IS UNDEFINED
</script>
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
chrome.runtime.sendMessage error “Message length exceeded”
how to set hours,minutes to my date