PDI practice question 14 of 30
Which three resources in an Aura component can contain JavaScript functions? Choose 3 answers
Full set: 201 questionsIn the Aura Component framework, JavaScript functions are housed in specific client-side resources within a component's bundle. The Controller (controller.js) contains functions that handle user actions and events. The Helper (helper.js) contains reusable JavaScript logic that can be called from the controller or renderer, promoting code reuse. The Renderer (renderer.js) contains JavaScript functions to override default rendering behavior and manage the component's DOM manipulation during its lifecycle. These three resources are the designated places for client-side JavaScript logic.
A. Style: The Style (.css) resource contains CSS rules for component styling and does not execute JavaScript.
D. Design: The Design (.design) resource is an XML file that defines design-time attributes for tools like the Lightning App Builder, not JavaScript functions.
1. Lightning Aura Components Developer Guide, Component Bundle:
Controller: "A client-side controller contains the JavaScript that defines the functions for all of the component's actions." (See section: "Component Bundle")
Helper: "A client-side helper can be considered a component library that contains a repository of JavaScript functions that can be used by any of the component's JavaScript code." (See section: "Component Bundle")
Renderer: "A client-side renderer modifies the default rendering behavior of a component. A renderer file is a JavaScript resource..." (See section: "Component Bundle")
Style: "The style resource contains the CSS rules for the component." (See section: "Component Bundle")
Design: "The design resource is required for a component to be used in Lightning App Builder... The design resource is an XML file..." (See section: "Component Bundle")
2. Lightning Aura Components Developer Guide, JavaScript Controller:
"A component’s client-side controller is a JavaScript object in the component bundle... The controller contains the action handlers that respond to events." (See section: "Creating and Using Actions")
3. Lightning Aura Components Developer Guide, Sharing JavaScript Code in a Helper:
"Put reusable JavaScript functions in a helper to share the code across a component’s controller and renderer." (See section: "Sharing JavaScript Code in a Helper")
Keep practicing
Take the free PDI practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PDI practice questions
- Question 1What can be used to override the Account's standard Edit button for Lightning Experience?
- Question 4Universal Containers (UC) wants to lower its shipping cost while making the shipping proc…
- Question 5A developer has an integer variable called maxAttempts. The developer needs to ensure tha…
- Question 7Universal Containers wants to back up all of the data and attachments in its Salesforce o…
- Question 8Universal Containers hires a developer to build a custom search page to help users find t…
- Question 9As part of new feature development, a developer is asked to build a responsive applicatio…
