This topic contains a solution. Click here to go to the answer

Author Question: What will the browser display if the following script is executed? < SCRIPT LANGUAGE = ... (Read 60 times)

segrsyd

  • Hero Member
  • *****
  • Posts: 530
What will the browser display if the following script is executed?
 
  < SCRIPT LANGUAGE = JavaScript >
  var theArray =  1, 2, 3, 4, 5, 6, 7, 8, 9 ;
  modifyArray( theArray 3  );
  document.write( theArray.join(   ) );
  function modifyArray( i )
  i = 11;
 
 
  a) Nothing, the browser will generate an error.
  b) 1 2 3 4 5 6 7 8 9
  c) 1 2 11 4 5 6 7 8 9
  d) 1 2 3 11 5 6 7 8 9

Question 2

What is the effect of the join statement in the following code? var theArray1 =  1, 2, 3, 4, 5, 6, 7, 8, 9, 10 , theArray2 =  1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ; var value = theArray1.join(   );
 
  a) The join method will concatenate the values of theArray2 to theArray1.
  b) The join method will concatenate the values of theArray1 to theArray2.
  c) The join method will create a string from the values in theArray1.
  d) The join method will create a string with the values of theArray2 concatenated to the values of theArray1.



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by a Subject Expert

Anonymous

  • Sr. Member
  • ****
  • Posts: 317
Answer to Question 1

Ans: (b)

Answer to Question 2

Ans: (c)




segrsyd

  • Member
  • Posts: 530
Reply 2 on: Jul 7, 2018
Excellent


parker125

  • Member
  • Posts: 332
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

Aspirin may benefit 11 different cancers, including those of the colon, pancreas, lungs, prostate, breasts, and leukemia.

Did you know?

Ether was used widely for surgeries but became less popular because of its flammability and its tendency to cause vomiting. In England, it was quickly replaced by chloroform, but this agent caused many deaths and lost popularity.

Did you know?

Vaccines prevent between 2.5 and 4 million deaths every year.

Did you know?

There are more bacteria in your mouth than there are people in the world.

Did you know?

To combat osteoporosis, changes in lifestyle and diet are recommended. At-risk patients should include 1,200 to 1,500 mg of calcium daily either via dietary means or with supplements.

For a complete list of videos, visit our video library