Import specific exports using curly braces. Names must match what was exported.
import { PI, double } from "./utils.js";
console.log(PI); // 3.14159
console.log(double(5)); // 10
You only import what you need. Unused exports don't load.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Import specific exports by name
Import specific exports using curly braces. Names must match what was exported.
import { PI, double } from "./utils.js";
console.log(PI); // 3.14159
console.log(double(5)); // 10
You only import what you need. Unused exports don't load.