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