QUIZ

1) What follows after the expression in an if statement?

Answer :curly braces

2) What is the substring keyword used for?

Answer: Returning a partial part of a string

3) Which of the following is the correct way to log a statement to the console?

Answer: console.log("Hello world");

4)Which of the following is the correct way of returning the length of the word 'string'?

Answer: 'string'.length

5)What best describes the variables in JavaScript?

Answer: To allow the user to save and call values

6) Which of the following is not a comparator operation in JavaScript?

Answer: <==

7) Which of the following is the correct way to declare a variable?

Answer: var myName

8) Which of the following is the correct use of the confirm dialog?

Answer: confirm(“Hello world”);

9) Which of the following statements returns false?

Answer: 'inputControl'.length < 4

10) Which statement returns the value of 2?

Answer: (3 + 1) \/ 'hi'.length

11) Which of the following returns 'llo' ?

Answer: 'hello world'.substring(2,5);

12) What is the function of the prompt dialog?

Answer: To ask the user for an input

13) Which of the following will correctly comment the text?

Answer:\/\/ “the text” \/\/

14) Which of the following returns 'he'?

Answer:'hello world'.substring(0,2);

results matching ""

    No results matching ""