Tutor Marked Assignment JS TMA-04
In a Nutshell - CIW Course Section 2 Part A
JS TMA-04 - CD Access Code: 14634
Q1. Indicate which of the following statements are correct:
- a) An array is a single variable with multiple slots for different values.
- b) Each slot can be revferenced by its index number.
- c) The first slot in an array has the index number of -1.
- d) JavaScript uses zero-based arrays.
Q2. What value would the following statement display:
"What value would the following statement display".indexOf("a",0);
- a) 1
- b) 2
- c) 3
- d) 0
Q3. What would be the result of the following expression:
"Result of expression".length;
- a) 18
- b) 19
- c) 20
- d) 21
Q4, What is the correct description for the following piece of syntax:
setTimeout(expression, time)
- a) Displays a message to the user after an elapse time of the interval time.
- b) Tracks the number of frames in a window after an elapse of the interval time.
- c) Runs the expression after an elapse of the interval time.
- d) Processes when the window or frame finishes loading.
Q5. String objects can only exist as variables:
- a) True
- b) False
Q6. Match each return type with the following methods in the math object.
- a) abs(num)
- b) ceil(num)
- c) floor(num)
- d) log(num)
- 1) Natural logarithm of num (base e).
- 2) Rounds num up to the next integer.
- 3) Rounds num down to the next integer.
- 4) Absolute value of num.
Q7. What value would the following statement return? "ZXCDTUIMOP".charAt(9)
- a) O
- b) P
- c) Z
- d) D
Q8. Access to an image cannot be gained through its array number:
- a) True
- b) False
Q9. What is the function of the substring() string evaluation method?
- a) Tests how many characters a string contains.
- b) Determines which character occurs at a specific position in a string.
- c) Examines a portion of a string.
- d) Tests for both the presence and position of a given character.
Q10. Strings cannot exist as literals in JavaScript.
- a) True
- b) False

