What capability is demonstrated with the destructuring in this example?
// Using dynamic import() with destructuring
async function loadFeature() {
const { initFeature, featureSettings } = await import('./feature.js');
// Only using specific exports from the module
initFeature(featureSettings.defaultOptions);
}
This example demonstrates direct access to named exports using destructuring: 1) The destructuring syntax extracts specific named exports from the module namespace object, 2) It provides a clean way to access exactly what's needed from the module, 3) The entire module is still loaded, but the code only references specific exports, 4) This approach is more concise than accessing through the module object (module.initFeature), 5) It maintains the semantic meaning of specifically using these exports, 6) The dynamic import still returns the complete module namespace object, 7) The destructuring happens after the module is loaded, not during loading, 8) This combines the flexibility of dynamic imports with the clarity of named imports.