ExamGecko
Question list
Search
Search

Question 207 - Certified B2B Commerce Developer discussion

Report
Export

What is one requirement to keep in mind when including additional JavaScript 1h files in a Lightning Web Component?

A.
The files must be ES6 modules and must have names that are unique within the component's folder.
Answers
A.
The files must be ES6 modules and must have names that are unique within the component's folder.
B.
Only five of the files can be used with an import statement
Answers
B.
Only five of the files can be used with an import statement
C.
All the files must be imported to a singleton.js file and the singleton.js file can be used with an import statement
Answers
C.
All the files must be imported to a singleton.js file and the singleton.js file can be used with an import statement
D.
Only one of the files can be used with an import statement
Answers
D.
Only one of the files can be used with an import statement
Suggested answer: A

Explanation:

When including additional JavaScript files in a Lightning Web Component, it is required that these files are ECMAScript 6 (ES6) modules and have unique names within the component's folder. This ensures proper module resolution and avoids namespace conflicts. Salesforce LWC documentation provides guidelines on organizing component resources, including JavaScript modules, to ensure they are correctly recognized and utilized within the LWC framework.

asked 23/09/2024
David Aghaegbuna
41 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first