JS-Dev-101 practice question 8 of 25
A developer wants to use a module named universalContainerslib and then call functions from it. How should a developer import every function from the module and then call the functions foo and bar?
Full set: 148 questionsimport as alias from "module" gathers every named export into a single namespace object (alias). Functions foo and bar are accessed as properties (alias.foo(), alias.bar()).
B. import syntax requires “as ”; without it the statement is invalid.
C. “all” is not valid ES6 import syntax; compilation error.
D. Destructuring import brings in only foo and bar, not every function as required.
1. ECMA-262, 13th ed., §15.2.2.14 “ImportDeclaration”, Grammar: import as IdentifierName from ModuleSpecifier.
2. Salesforce Lightning Web Components Dev Guide, “ES Modules”, section “Namespace imports” (alias.foo()).
Keep practicing
Take the free JS-Dev-101 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other JS-Dev-101 practice questions
- Question 1A developer executes: document.cookie; document.cookie = 'key=John Smith'; What is the be…
- Question 2A developer is required to write a function that calculates the sum of elements in an arr…
- Question 3Given the code below: 01 const delay = async delay => { 02 return new Promise((resolve, r…
- Question 401 function Animal(size, type) { 02 this.type = type || 'Animal'; 03 this.canTalk = false…
- Question 5Refer to the code snippet: 01 let array = [1, 2, 3, 4, 4, 5, 4, 4]; 02 for (let i = 0; i …
- Question 6Code: 01 let array = [1, 2, 3, 4, 4, 5, 4, 4]; 02 for (let i = 0; i < array.length; i++) …
