nerdexam
Salesforce

PDII · Question #266

A developer created a JavaScript library that simplifies the development of repetitive tasks and features and uploaded the library as a static resource called jsUtils in Salesforce. Another…

The correct answer is C. import jsUtilities from '@salesforce/resourceUrl/jsUtils'. See the full explanation below for the reasoning.

Question

A developer created a JavaScript library that simplifies the development of repetitive tasks and features and uploaded the library as a static resource called jsUtils in Salesforce. Another developer is coding a new Lightning web component (LWC) and wants to leverage the library. Which statement properly loads the static resource within the LWC?

Options

  • A<lightning-require scripts=N { ! SReaource. j sUtils}''/>
  • Bimport {jsUtilities} from '@salesforce/resourceUrl/jsUtils';
  • Cimport jsUtilities from '@salesforce/resourceUrl/jsUtils';
  • Dconst jsUtility = $A.get ('$Resource.jsUtils');

How the community answered

(37 responses)
  • A
    5% (2)
  • B
    16% (6)
  • C
    73% (27)
  • D
    5% (2)

Community Discussion

No community discussion yet for this question.

Full PDII Practice