JavaScript 6e – Test Review Questions
Chapter 10: Programming for Mobile Devices and Touchscreens
True / False	

1. On a touchscreen device without a mouse, most browsers fire the click event when a user touches the screen.​
 	
a. 	
True	

b. 	
False	

REFERENCES:  	
623	

	

2. Touch events are built to allow for multiple touches on the screen at the same time.
 	
a. 	
True	

b. 	
False	

REFERENCES:  	
693	

3. Pointer events do not aim to handle input from a mouse.
 	
a. 	
True	

b. 	
False	

REFERENCES:  	
697	

4. ​The Geolocation API provides access to device orientation and changes in orientation.
 	
a. 	
True	

b. 	
False	

REFERENCES:  	
700	

5. The mobile versions of popular browsers share all the same capabilities, limitations, and even bugs as their desktop counterparts.​
 	
a. 	
True	

b. 	
False	

REFERENCES:  	
717	

Multiple Choice	

6. ​Which of the following is a mouse event?
 	
a. 	
​touchstart	
b. 	
​click	

c. 	
​pointerup	
d. 	
​clientX	

REFERENCES:  	
684	

7. ​Which of the following is a touch event?
 	
a. 	
​touchend	
b. 	
​mousedown	

c. 	
​pointermove	
d. 	
​clientY	

REFERENCES:  	
690	

8. ​Which of the following is a pointer event?
 	
a. 	
​touchcancel	
b. 	
​mouseout	

c. 	
​pointerdown	
d. 	
​clientX	

REFERENCES:  	
697	

9. Which event is fired when a user moves a finger off the screen or outside of an object's containing element?​
 	
a. 	
​touchstart	
b. 	
​touchmove	

c. 	
​touchend	
d. 	
​touchcancel	

REFERENCES:  	
690	

10. ​The touchstart event is roughly analogous to the ____ event.
 	
a. 	
​click	
b. 	
​mouseup	

c. 	
​mousedown	
d. 	
​mouseover	

REFERENCES:  	
690	

11. To disable interface gestures in response to pointer events, you change the value off the ____ property.​
 	
a. 	
​touches	
b. 	
​clientX	

c. 	
​touchAction	
d. 	
​msTouchAction	

REFERENCES:  	
698	

12. You access methods of the Geolocation API using the geolocation property of the ____ object.​
 	
a. 	
​Screen	
b. 	
​Window	

c. 	
​Navigator	
d. 	
​Location	

REFERENCES:  	
700	

13. To request a user's position a single time, you use the ____ method of the Geolocation API.​
 	
a. 	
​getCurrentPosition()	
b. 	
​watchPosition()	

c. 	
​clearWatch()	
d. 	
​latitude()	

REFERENCES:  	
701	

14. To continually monitor a user's position, you use the ____ method of the Geolocation API.​
 	
a. 	
​getCurrentPosition()	
b. 	
​watchPosition()	

c. 	
​clearWatch()	
d. 	
​latitude()	

REFERENCES:  	
701	

15. A device's ____ detects its orientation in space.​
 	
a. 	
​gyroscope	
b. 	
​camera	

c. 	
​accelerometer	
d. 	
​battery	

REFERENCES:  	
716	

16. A device's ____ detects changes in speed.​
 	
a. 	
​gyroscope	
b. 	
​camera	

c. 	
​accelerometer	
d. 	
​battery	

REFERENCES:  	
716	

17. Which of the following is NOT removed when minifying a file?​
 	
a. 	
spaces​	
b. 	
​comments	

c. 	
​indents	
d. 	
​line breaks	

REFERENCES:  	
722	

18. The success and fail arguments of the getCurrentPosition() method, which are executable code, are examples of ____.​
 	
a. 	
​API keys	
b. 	
​properties	

c. 	
callbacks	
d. 	
​minifiers	

REFERENCES:  	
701	

19. Which type of events focus on responding to finger touches on a touchscreen?​
 	
a. 	
​Drag events	
b. 	
​Pointer events	

c. 	
​Touch events	
d. 	
​Mouse events	

REFERENCES:  	
689	

20. Which type of events aim to handle input from a mouse, finger, or stylus with each event?​
 	
a. 	
​Drag events	
b. 	
​Pointer events	

c. 	
​Touch events	
d. 	
​Mouse events	

REFERENCES:  	
697	

21. Which array contains coordinates of all touches currently on the screen?​
 	
a. 	
​touches	
b. 	
​allTouches	

c. 	
​targetTouches	
d. 	
​changedTouches	

REFERENCES:  	
693	

22. Pointer events are supported only by certain versions of which browser?
 	
a. 	
Mozilla Firefox	
b. 	
Google Chrome	

c. 	
Apple Safari	
d. 	
​Microsoft Internet Explorer	

REFERENCES:  	
697, 698	

23. The object returned by the getCurrentPosition() method of the Geolocation API contains a single property named ____.
 	
a. 	
​coordinates	
b. 	
​coords	

c. 	
​geolocation	
d. 	
​geo	

REFERENCES:  	
701	

24. In the Google Maps API, the ____ constructor creates a map object.​
 	
a. 	
Create()​	
b. 	
​New()	

c. 	
​Map()	
d. 	
​LatLng()	

REFERENCES:  	
711	

25. In the Google Maps API, you specify coordinates with the ____ constructor.​
 	
a. 	
Coords()​	
b. 	
​Coordinates()	

c. 	
​New()	
d. 	
​LatLng()	

REFERENCES:  	
711	

Completion	

26. In a touch __________, a browser checks a touched element for an event handler for multiple events, including some mouse events.​
REFERENCES:  	
689​	

27. By adding the __________ method within event handler code, you prevent touch actions on specific elements from also triggering interface gestures.
REFERENCES:  	
695​	

28. Converting a physical address to a pair of latitude and longitude coordinates is known as __________.​
REFERENCES:  	
713​	

29. __________ is the process of making it clear to users what information your app wants to collect from them and how you intend to use it.​
REFERENCES:  	
702​	

30. Large-volume users of the Google Maps API need an API __________, which is a string of characters that you incorporate into any request your code makes to Google to verify that your use is licensed.
REFERENCES:  	
710​	

Subjective Short Answer	

41. Explain the difference in how you reference coordinates between mouse events and touch events.​
REFERENCES:  	
692, 693.	

42. Explain why you need to be able to distinguish between app and device interaction when interpreting touch events.​
REFERENCES:  	
694, 695	

43. Why is it necessary for geolocation code to allow for a lack of response to a permission request?​
REFERENCES:  	
707	

44. Provide two reasons why it's important to minimize download size for a mobile app.​
REFERENCES:  	
718, 719	

45. What does it mean to load scripts responsively?​
REFERENCES:  	
719.​	

46. What is the difference between a synchronous callback and an asynchronous callback?​
REFERENCES:  	
721	

47. Explain what the Battery Status API does and provide an example of how it could be used.​
REFERENCES:  	
716	

48. Explain what the Device Orientation API does and provide an example of how it could be used.​
REFERENCES:  	
716, 717.	

49. What are some different ways to test a mobile app on different mobile platforms?​
REFERENCES:  	
717, 718	

50. How can you make changes or enhancements to an app that uses a minified file?​
REFERENCES:  	
723