1. What does LWC stand for?
- a) Lightning Web Connector
- b) Lightning Web Components
- c) Lightning Widget Components
- Answer: Lightning Web Components
2. Which file is used for the JavaScript code in a Lightning Web Component?
- a) .html
- b) .js
- c) .xml
- Answer: .js
3. What is the purpose of the
connectedCallback
lifecycle hook?- a) To handle button clicks
- b) To manipulate the component's DOM after it is connected
- c) To define component attributes
- Answer: To manipulate the component's DOM after it is connected
4. How do you pass data from a parent component to a child component in LWC?
- a) Using a Lightning event
- b) Using a method call
- c) Through the component's HTML
- Answer: Using a Lightning event
5. What is the primary role of Apex in Lightning Web Components?
- a) Styling the components
- b) Handling server-side logic and data retrieval
- c) Defining component structure
- Answer: Handling server-side logic and data retrieval
6. How can you conditionally render content in LWC?
- a) Using JavaScript if statements
- b) Using the
template if:true
directive - c) Both a and b
- Answer: Both a and b
7. What does the term "shadow DOM" refer to in LWC?
- a) A hidden area in the Salesforce database
- b) A secure connection to the Lightning Platform
- c) Isolated DOM tree for a Lightning Web Component
- Answer: Isolated DOM tree for a Lightning Web Component
8. Which tool is commonly used for testing Lightning Web Components?
- a) Mocha
- b) Jest
- c) Karma
- Answer: Jest
9. How do you deploy a Lightning Web Component to a Salesforce org?
- a) Copy-pasting the code into the Developer Console
- b) Using Salesforce CLI commands
- c) Sending it as an email attachment to Salesforce support
- Answer: Using Salesforce CLI commands
10. What is the purpose of the
@api
decorator in LWC?- a) To define a public property
- b) To hide the component from other modules
- c) To specify the component's API version
- Answer: To define a public property
0 Comments
Post a Comment