Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Answer the following questions: Create a JavaScript array that contains the name

ID: 3913333 • Letter: A

Question

Answer the following questions:

Create a JavaScript array that contains the names of each of the loops available in JavaScript. Each loop name should constitute one element of the array.

Write JavaScript code to display the names of the JavaScript loops (from the array in the previous question) in a single alert message. One loop name should be displayed on each line.

When creating an array, is it better to create a dynamic array or a static array? Explain your answer. Be sure to discuss each type of array in your answer.

Write the commands to create a confirm message to ask the user if they would like to submit their order. If the user clicks OK, assign the variable named submitted to true. If the user clicks Cancel, assign the variable named submitted to false. Assume that the variable named submitted has already been created.

Is the following statement true or false? Explain your answer.

When opening a new Web browser window, you should use the window.open JavaScript method instead of the target attribute.

Explanation / Answer

Here is your answer:

Answer:

<script>

var nameArray=["for","for_in","while","do_while"];      <!--array containg all loop name in js!-->

var name="";     <!--to store sum of array element!-->

for(var i=0;i<nameArray.length;i++)        <!--for loop!-->

{

                name+=" "+nameArray[i];      <!--storing each element with new line into name var!-->

}

alert(name);      <!--printing var name in alert!-->

var submitted=confirm("Submit order");              <!--command to show confirm msg and storing user action to var submitted!-->

</script>

Dynamic or static array, which one better well that’s depend on what kind of variable we are creating we actually can’t say dynamic is better than static or vice versa, for instance consider a situation when we don’t know how much data we are going to store or receive so in that case we will create dynamic array now consider a situation when we exactly know length of data going to store in array so then we will create static array and in this situation there is no point of creating dynamic array because creating static array is faster in creating, deleting, inserting, reading as compare to creating dynamic array

No this statement is false(“When opening a new Web browser window, you should use the window.open JavaScript method instead of the target attribute.”) because window.open requires javascript and that maybe blocked by popup blocker like ad blocker etc and in many mobile it will get ignored so I say use target whenever possible.

I hope this solved your problem

Comment if you have any problem in above answer

And please give it a thumbs up if it solved your problem :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote