Multiple Choice Identify the
choice that best completes the statement or answers the question.
|
|
1.
|
How do you declare a JavaScript variable?
a. | variable carName; | c. | v carName; | b. | var carName; |
|
|
2.
|
How do you create a function in JavaScript?
a. | function myFunction( ) | c. | function:myFunction( ) | b. | function =
myFunction( ) |
|
|
3.
|
How do you write “Hello Word” in an alert box?
a. | msg(“Hello World”); | c. | alert(“Hello
World”); | b. | msgBox(“Hello World”); | d. | alertBox(“Hello
World”) |
|
|
4.
|
Which operator is used to assign a value to a variable?
|
|
5.
|
Inside which HTML element do we put the JavaScript?
a. | <js> | c. | <javascript> | b. | <script> | d. | <scripting> |
|
|
6.
|
How do you add a comment in JavaScript?
a. | #This is a comment | c. | ‘This is a comment | b. | //This is a
comment |
|
|
7.
|
How do you call a function named “myFunction”?
a. | myFunction( ) | c. | call myFunction( ) | b. | call function myFunction(
) |
|
|
8.
|
JavaScript statements are composed of values, operators, keywords and must end
with a
|
|
9.
|
Where is the correct place to insert a JavaScript
a. | Both the <head> and <body> section are correct | c. | The <body>
section | b. | The <head> section |
|
|
10.
|
Converts a input string to a integer value.
a. | float | c. | parseFloat | b. | int | d. | parseInt |
|