Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

IT Specialist HTML5 Application Development (INF-306) Free Practice Test

Question 1
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.
Correct Answer:

Explanation:
Line 26 drop-down: 5
Line 29 drop-down: 8
Line 32 drop-down: 6
The groceries array starts empty. Line 24 runs fruits.shift(), which removes " Apples " from the fruits array.
This leaves four fruits, but it does not add anything to groceries. Line 25 calls addVegetables(), which executes groceries = groceries.concat(vegetables);. Since vegetables contains five items, groceries contains 5 items at line 26. Line 27 then executes groceries.shift(), removing the first item from groceries and reducing the count to 4. Line 28 calls addFruits(), which appends the four remaining fruits, increasing the array count to 8; therefore, line 29 is 8. Line 30 executes groceries.pop(), removing the last item and reducing the count to
7. Line 31 executes groceries.shift(), removing the first item and reducing the count to 6. Therefore, line 32 is
6. The addOther() function on line 33 has not executed yet at the line 32 breakpoint. References/topics:
JavaScript arrays, debugging breakpoints, concat(), shift(), pop(), push(), array item counting.
Question 2
Review the grid container requirements and mockup on the left. Which markup should you use to define the grid container?

Correct Answer: B
Question 3
You need to use a flexbox so that new content you add to the container appears at the highest point on a vertical list. You want to achieve this goal without specifying an order. Which value should you use for flex- direction?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 4
You need to display the following user interface:
Motorcycle
Truck
Boat
Car
Bicycle
Complete the markup by selecting the correct option from each drop-down list.
Correct Answer:

Explanation:
First drop-down: datalist
Second drop-down: vehicles
Third drop-down: < /datalist >
The correct element is < datalist > because the interface requires a text input that provides selectable suggestions while still allowing the user to type. The < input > element uses list= " vehicles " , so it must be connected to a < datalist > element whose id is exactly vehicles. The id cannot be vehicle, because vehicle is already the input element's own identifier and does not match the value used by the list attribute. The < option
> elements inside the datalist define the suggested values: Motorcycle, Truck, Boat, Car, and Bicycle. ul, ol, and li are list-markup elements and do not create input suggestions. select would create a fixed dropdown list, but it would not match the editable input-with-suggestions behavior shown. The closing tag must match the opening datalist element, so the final selection is < /datalist > .
Question 5
You have created custom error messages for a form. When a user attempts to submit the form with invalid data, the data must remain in the form and error messages must be displayed. Which Event property or method should you use?

Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
You create an interface for a touch-enabled application. You discover that some of the input buttons do not trigger when you tap them on the screen. You need to identify the cause of the problem. What are two possible causes? Choose 2.

Correct Answer: B,D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 7
Which two code segments declare a JavaScript method? Choose 2.

Correct Answer: C,D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).