Thursday, April 5, 2007

You are Smart When You Know Your JavaScript

Ok, so maybe you tinker with it, but how well do you really know this programming language? It is one of the most widely used languages, but it is probably known inside-out by less people than Cobol. People still use Cobol, right? Here is the quiz...


1. What was the original name of JavaScript?
a) Oak
b) LiveScript
c) Mocha
d) DOM Script

2. Who invented JavaScript?
a) Brendan Eich
b) Bill Gates
c) Danny Goodman
d) Fritz Schneider

3. How do you write a for loop in JavaScript?
a) for(int i =0; i < 10; i++){...
b) for i = 0 to 10 ...
c) for (var i = 0; i < 10; i++){...
d) for (var i = 0, i < 10, i++){...

4. In JavaScript, what does the "continue" statement do?
a) Terminates execution of the statements in the current if statement and continues to the next statement outside the current block.
b) Terminates execution of the statements in the current iteration of the current or labelled loop, and continues execution of the loop with the next iteration.
c) Continues execution of the statements in the current iteration of a loop after a break statement has been executed.
d) Causes the execution of the statements in the current function to be skipped.

5. Which of the following is a complete list of logical operators in JavaScript?
a) &, |, !
b) &&, ||
c) +, -, *, /, %, ++, --
d) &&, ||, !

6. How do you create comments within your code in JavaScript?
a) //
b) @
c) --
d) #

7. Which of the following in not a global object?
a) Array
b) RegExp
c) Error
d) int

8. What does the Date.UTC function return?
a) The number of milliseconds in a Date object since January 1, 1900, 00:00:00, universal time.
b) Converts the parameter passed in to the equivalent string representation of the date to UTC representation
c) The number of milliseconds in a Date object since January 1, 1970, 00:00:00, universal time.
d) Converts a UTC representation of a date into a date object.

9. Which of the following is not a tool related to JavaScript?
a) Venkman
b) JSLint
c) CupOfJoe Debugger
d) FireBug

10. Which of the following is not a method of the XMLHttpRequest object?
a) abort()
b) getRequestHeader(label, value)
c) getResponseHeader(headerName)
d) setRequestHeader(label, value)