Salesforce Certified Platform Developer II — Question 154
How can a developer efficiently incorporate multiple JavaScript libraries, such as JQuery and MomentJS, in a Lightning component?
Answer options
- A. Use JavaScript remoting and script tags
- B. Use CDNs with script attributes
- C. Implement the libraries in separate helper files
- D. Join multiple assets from a static resource
Correct answer: D
Explanation
The correct answer is D because combining multiple assets into a single static resource optimizes loading times and simplifies management. Options A and B are less efficient as they involve external calls or multiple script tags, while option C does not leverage the advantages of using static resources for bundling libraries.