Computer Science - JavaScript 1 Exam
Enter your name, print this page, and hand it in.
Name:    Date:  
1. Who originally developed Javascript?
a. Netscape c. Sun
b. Microsoft d. Hewlett Packard Bell Labs
2. What type of language is JavaScript?
a. Compiled c. Object-oriented
b. Interpreted d. Object-un-oriented
3. Javascript is what kind of language?
a. Server-side c. OOP
b. Client-side d. Linoleum
4. Which command holds values and can be accessed repeatedly?
a. Object c. Variable
b. Parameters d. Constrictor
5. Which command allows the user to enter data?.
a. prompt() c. alert()
b. document.write() d. onLoad()
6. Which command allows the text to be written into a page as it is loading onto a browser?
a. prompt() c. alert()
b. document.write() d. onLoad()
7. Which command displays a pop-up message box?
a. prompt() c. alert()
b. document.write() d. onLoad()
8. What are the constraints on naming JavaScript variables? (Check all that apply)
a. Must start with a letter c. May contain dash or underline
b. May contain letters and numbers d. May NOT contain spaces or special characters
9. Which of the following is a "decision" statement?
a. when() c. for()
b. prompt() d. if()
10. Which of the following is a "loop" statement?
a. when() c. for()
b. prompt() d. if()
11. Where is the correct place to insert a JavaScript?
a. The section <head> section c. Both
b. The section <body> section d. Neither
12. Inside which HTML element do we put the JavaScript?
a. <script> c. <js>
b. <javascript> d. <scripting>
13. What is the correct JavaScript syntax to write "Hello World"?
a. "Hello World" c. response.write("Hello World")
b. ("Hello World") d. document.write("Hello World")
14. What is the correct syntax for referring to an external script called "xxx.js"?
a. <script name="xxx.js"> c. <script href="xxx.js">
b. <script src="xxx.js"> d. It can't be done
15. An external JavaScript must contain the <script> tag.
True False
16. How do you create a function?
a. function=myFunction() { } c. function myFunction() { }
b. dim myFunction() as function d. It can't be done
17. How do you call a function named "myFunction"?
a. call myFunction() c. function myFunction() { }
b. myFunction() d. It can't be done
18. How many statements are there in JavaScript?
a. 1 - Sequential c. 2 - Sequential and Decision
b. 3 - Sequential and Decision and Loop d. 0 none, you can't make statements in JavaScript
19. How many decision statements are there in JavaScript?
a. 1 - if() c. 3 - if() and if() else and select() case
b. 2 - if() and if() else d. 0 - none, you can't make decisions in JavaScript
20. How many looping statements are there in JavaScript?
a. 1 - for() c. 3 - for() and while() and do while()
b. 2 - for() and while() d. 0 - none, you can't make loops in JavaScript