📜  导入一切 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:38.040000             🧑  作者: Mango

代码示例1
// The file you wish to export: (add.js)
export { add };
const add = (n1, n2) => n1 + n2;

// The file where you want to import it: (script.js)
import * as Addition from "./add.js";
const test1 = Addition.add(10, 20) // Results to 30
const test2 = Addition.add(100, 1) // Results to 101