Importer tout JavaScript

// 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
dead.dev