Exam 10: Javascript: Arrays

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

What is the effect of the join statement in the following code Var theArray1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; Var theArray2 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; Var value = theArray1.join( " " );

Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
Verified

C

Pass-by- ________ is the method of passing the argument's address in memory to a function.

Free
(Multiple Choice)
4.7/5
(31)
Correct Answer:
Verified

D

Which of the following is an illegal array initialization statement

Free
(Multiple Choice)
4.8/5
(44)
Correct Answer:
Verified

C

What would the browser output if the following script is executed < script type = "text/javascript" > < !-- Var array = [ [ 1, 2, 3 ], [ 1, 2, 3 ] ]; For ( var i in array ) { For ( var j in array[ i ] ) Document.write( array[ i ][ j ] + " " ); Document.writeln("< br / >"); } //-- > < /script >

(Multiple Choice)
4.8/5
(34)

What does the following code do For ( var col = 0; col < a[ 2 ].length; ++col ) A[ 2 ][ col ] = 0;

(Multiple Choice)
4.8/5
(41)

Which of the following is the proper method to dynamically allocate memory to an array of 100 elements

(Multiple Choice)
4.9/5
(30)

In JavaScript, numbers and boolean values are passed to functions by ________.

(Multiple Choice)
4.8/5
(34)

The first statement below ________ the array while the second statement ________ the array. Var c; C = new Array( 12 );

(Multiple Choice)
4.9/5
(32)

_________ are data structures consisting of related data items (sometimes called collections of data items).

(Multiple Choice)
4.8/5
(44)

Which of the following is the proper method to access the length of the array arr

(Multiple Choice)
4.9/5
(42)

By default, the JavaScript sort method uses ________ to sort the array passed to it.

(Multiple Choice)
4.8/5
(32)

The sort method can be given a function to use for the comparisons it makes, called a(n) ________ function.

(Multiple Choice)
4.9/5
(31)

What will the browser display if the following script is executed < script type = "text/javascript" > < !-- Var theArray = [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]; ModifyArray( theArray[ 3 ] ); Document.write( theArray.join( " " ) ); Function modifyArray( i ) { I = 11; } //-- > < /script >

(Multiple Choice)
4.8/5
(35)

When working with data stored in arrays, it's often necessary to determine whether an array contains a value that matches a certain ________.

(Multiple Choice)
4.8/5
(38)

What is the value of num assuming that all 12 elements of array test are initialized to 3 ++test[ 7 ]; Var num = test[ 7 ];

(Multiple Choice)
4.8/5
(33)

Pass-by- ________ is the method of passing a copy of the argument's value to a function.

(Multiple Choice)
4.9/5
(30)

To refer to a particular location or element in the array, we spec ify the name of the array and the ________ of the particular element in the array.

(Multiple Choice)
4.8/5
(38)

In JavaScript, all objects and arrays are passed to functions by ________.

(Multiple Choice)
4.8/5
(30)
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)