Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: force70

IT Specialist HTML5 Application Development INF-306 Question # 10 Topic 2 Discussion

IT Specialist HTML5 Application Development INF-306 Question # 10 Topic 2 Discussion

INF-306 Exam Topic 2 Question 10 Discussion:
Question #: 10
Topic #: 2

The following code adds items to the groceries array from the other arrays. Line numbers are for reference only.

01 < body >

02 < p id= " list " > < /p >

03 < script >

04 var groceries = [];

05 var dairy = [ " Milk " , " Eggs " , " Cheese " , " Ice Cream " ];

06 var beverages = [ " Juice " , " Water " , " Soda " , " Coffee " ];

07 var fruits = [ " Apples " , " Bananas " , " Grapes " , " Oranges " , " Strawberries " ];

08 var vegetables = [ " Broccoli " , " Carrots " , " Lettuce " , " Spinach " , " Tomatoes " ];

09 var meats = [ " Beef " , " Chicken " , " Pork " ];

10

11 function addVegetables() {

12 groceries = groceries.concat(vegetables);

13 }

14

15 function addFruits() {

16 groceries = groceries.concat(fruits);

17 }

18

19 function addOther() {

20 groceries.push(meats[1]);

21 groceries.push(dairy[3]);

22 }

23

24 fruits.shift();

25 addVegetables();

26

27 groceries.shift();

28 addFruits();

29

30 groceries.pop();

31 groceries.shift();

32

33 addOther();

34 document.getElementById( " list " ).innerHTML = groceries;

You need to debug the code on the left to determine how many items are in the groceries array at the specified breakpoints.

Evaluate the code and answer the questions by selecting the correct option from each drop-down list.

Note: You will receive partial credit for each correct answer.

INF-306 Question 10


Get Premium INF-306 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.