You are on page 1of 3

Dashboard / Courses / BLENDED 1923T.

B / BL-CS-301-LEC-1923T / Week 13: JavaScript Functions / Quiz 006

Started on Wednesday, 8 January 2020, 2:10 PM


State Finished
Completed on Wednesday, 8 January 2020, 2:14 PM
Time taken 4 mins 2 secs
Marks 9/10
Grade 90 out of 100

Question 1 What is the result of the script below?


Correct <script>
Mark 1 out of 1 var n = ["Maria", "Isabella", "Georgina"];
n.shift();
n.unshift("Maria");
document.write(n);
</script>

Select one:
a. Maria,Isabela,Georgina 

b. Isabela,Georgina,Maria

c. None of the choices

d. Maria,Isabela,Georgina,Maria

Your answer is correct.

Question 2 Which of the following is a valid name for an array?


Correct

Mark 1 out of 1 Select one:


a. soap 

b. my array

c. None of the choices

d. 2ndarray

Question 3 How many times can you nest a code block within another?
Correct

Mark 1 out of 1 Select one:


a. As many times as you like (though enough nesting could run the browser out of memory) 

b. Once

c. None

d. None of the above

Question 4 What property of the Array object will return the numeric value of the length of an array?
Correct

Mark 1 out of 1 Select one:


a. None of the choices

b. The length property 

c. The getlength property

d. The lengthOf property


Question 5 What do you use to enclose the blocks of code in conditionals and loops?
Correct

Mark 1 out of 1 Select one:


a. Curly brackets 

b. Square brackets

c. Parentheses

d. None of the choices

Question 6 Rather than executing every single line of code within the script, a conditional statement allows certain sections
Correct of the script to be executed only when a particular condition is met.
Mark 1 out of 1
Select one:
a. False

b. True 

Question 7 What does the following code do?


Correct var s_list= new Array()
Mark 1 out of 1
Select one:
a. Creates an array named s_list with the default number of elements, 10

b. Creates an empty array named list

c. None of the choices 

d. Creates an array that can never have any elements added to it

Question 8 Which of the following would be valid as the first line of an if/else statement?
Correct

Mark 1 out of 1 Select one:


a. if (x==2) && (y > x)

b. if (x=2)

c. if (y ! 7)

d. None of the choices 

Your answer is correct.

Question 9 Which of the following will correctly access the fifth element of an array named "age"?
Correct

Mark 1 out of 1 Select one:


a. None of the choices

b. age[4]; 

c. age(5);

d. age[5];

Question 10 Which of the following does not correctly create an array?


Incorrect

Mark 0 out of 1 Select one:


a. None of the choices 

b. var myarray= new Array(5);

c. var myarray= new Array(“hello”,”hi”,”greetings”);

d. var if= new Array[10];


◄ Lesson 11: JavaScript Functions Jump to... Finals ►

You might also like