Problem
Assume you have created an array of pets:
var mypets = new Array();
mypets[0] = "dog";
mypets[1] = "cat";
mypets[2] = "goldfish";
Write a JavaScript code to answer the following questions:
• Add a for loop to print out the array
• Write a fragment of code to insert a new pet named ‘turtle'to the end of mypets array .
• Write a fragment of code to removes the pet named ‘turtle' from mypets array.
The response should include a reference list. Using double-space, Times New Roman 12 pnt font, one-inch margins, and APA style of writing and citations.