TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kalpana jaiswal
NA
45
9.8k
Objects In Javascript.
Dec 3 2017 11:02 AM
<html>
<head>
<title>User-defined objects</title>
<script type="text/javascript">
function
book
(title, author){
this.title = title;
this.author = author;
}
</script>
</h ead>
<body>
<script type="text/javascrAipt">
var myBook = new book("Perl", "Mohtashim");
document.write("Book title is : " + myBook.title + "<br>");
document.write("Book author is : " + myBook.author + "<br>");
</script>
</body>
</html>
in above code we have not declare title and author in function then how i am able to access it without any error. bec according to oops programing concept we can use variable without its declaration....
Reply
Answers (
1
)
call javascript function using submit button
How much Give Project Cost to Client?