ar for web using javascript coursera week 2 answers

How to script in PlayCanvas quiz

1. Select the best answer to complete the following statement. A Web AR application is divided into two code bases: The Engine and __________________.

  • Functions
  • Scripts
  • Control structures
  • Operators

2. Which of the following are examples of script attributes? Select all that apply.

  • Curve
  • Entity
  • JSON
  • Cast shadows

3. Events are a way of communicating between scripts: The system fires a signal that an event has occurred that triggers another event that is created to respond to the first event by initiating a specific reaction. Select the best answer.

  • True
  • False

4. Pc is the namespace for JavaScript. It gives you access to all the functions, types, properties and so on that were created and defined for your application. Select the best answer.

  • True
  • False

JavaScript in PlayCanvas quiz

5. Which of the following statements best describes how JavaScript is used in PlayCanvas? Select all that apply.

  • Adds custom behaviors to entities
  • Can be thought of as divided into two code bases
  • Mimics Java’s object model
  • Relies on a single code base

6. Conditionals, loops and jumps control the flow of the program. They are examples of which of the following? Select the best answer.

  • Constructors
  • Prototypes
  • Scope
  • Control structures

7. How can you access the API Reference directly from the PlayCanvas Code Editor? Select the best answer.

  • From Navigate
  • From Preferences
  • From Help
  • From File

8. The entity for the PlayCanvas engine that gives you access to all the JavaScript functions, types, properties that were created for PlayCanvas is pc. Select the best answer.

  • True
  • False

9. True or false: Events are recommended to communicate between scripts: The system fires a signal that an event has occurred that triggers another event that is created to respond to the first event by initiating a specific reaction. Select the best answer.

  • True
  • False

10. What allows you to only have to write code once and then adjust and modify values in the Editor UI instead of writing new code? Select the best answer.

  • Command palette
  • Trigger events
  • Script attributes
  • JavaScript events

11. Which of the following is a best practice when collaborating with other team members in the Code Editor? Select the best answer.

  • Maintain constant communication with others working in the same script.
  • Disable overwrite to prevent accidental errors.
  • Use the status bar to revert to your original file if an error is made.
  • Never watch what another team member is doing in real time.

12. Which of the following is a best practice for verifying a script you have created in the PlayCanvas Code Editor? Select all that apply.

  • Use Developer Tools to go step by step through scripts in order to observe how the code is behaving while the application is running.
  • Use the Console to access the API Reference to verify code.
  • After breakpoints have been set, refresh PlayCanvas to run the file.
  • The tools you’ll need for debugging JavaScript will have the same names no matter what browser you’re using.

13. True or false: To optimize the loading by reducing the number of requests that are needed to load all of your scripts, all preloaded scripts are concatenated into a single script file by default when you publish or export your application. Select the best answer.

  • True
  • False

14. True or false: There’s no way you can learn everything you will need for every project to verify and debug your application scripts! Select the best answer.

  • True
  • False

Leave a Reply