Home
• Programming • JavaScript
Apr 24th, 2015 at 11:28 PM
Quiz-1 : JavaScript Basic
1. Which of the following is the correct syntex of "for" loop?
A) for (i = 0; i <= 5; i++;){
}
B) for (i = 0; i <= 5; i++){
}
C) for i = 1 to 5
end for
D) for (i <= 5; i++){
}
2. You work on a JavaScript project. How do you prompt users with messages and at the same time requesting user inputs?
A) alert()
B) display()
C) prompt()
D) input()
3. Which are the correct comparison operators?
A) >=,<=,==,=!
B) >=,<=,==,!=
C) =<,=>,==,=!
D) >=,=<,==,!=
4. How do you call a function named "myFunction"?
A) call function myFunction()
B) myFunction()
C) call myFunction()
D) none
5. What is the correct JavaScript syntax for opening a new window called "window5" ?
A) new("http://www.ex-designz.net","window5")
B) window.open("http://www.ex-designz.net","window5")
C) open.new window("http://www.ex-designz.net","window5")
D) new.window("http://www.ex-designz.net","window5")
6. In some case, which of the following could be replacement for "if"?
A) for
B) while
C) do-while
D) switch-case
7. What is the correct syntax for referring to an external script called "file.js"?
A) <script name="file.js" type=”text/javascript”></script>
B) <script href="file.js" type=”text/javascript” />
C) <script src="file.js" type=”text/javascript”></script>
D) <link src="file.js" type=”text/javascript” />
8. Your company assigns you to work on a JavaScript project. With the DATE object, which of the following allows you to call a function based on an elapsed time?
A) setElapsedTime()
B) Timeout()
C) setTimeout()
D) setTime()
9. What will produce the output of following JavaScript code?
<script type="text/javascript">
document.write(parseFloat(9+10));
</script>
A) 19
B) 19.00
C) 910
D) error
10. What is the correct way to write a one dimensional JavaScript array?
A) var txt = new Array(1:"tim",2:"shaq",3:"kobe")
B) var txt = new Array="tim","shaq","kobe"
C) var txt = new Array("tim","shaq","kobe")
D) var txt=["tim","shaq","kobe"]
E) var txt = new Array()
txt[0]="tim"
txt[1]="shaq"
txt[2]="kobe"
First
Prev
Next
Last
/4
Comments 0
Comment
About Author
VCampus
Online Tips
Computer
2+
Mobile
4+
Religious
3+
Study
1+
Recipe
1+
Jobs
IT & Telecommunication
1+
General Subjects
Drawing
1+
Computing
1+
Math
1+
Programming
C++
1+
PHP
3+
JavaScript
4+
Java
1+
University
Campus
12+
General Knowledge
English & Literature
2+
Science & Technology
1+
Software Application
Microsoft Excel
2+
Schools
App Store
Whiteboard
Blogs
Quiz
Test
Apply Course
Games
Freelancers
Professionals
Newspapers
Terms
Privacy
Copyright © 2024. Powered by
Intellect Software Ltd
Comments 0