Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
// math.js exports: PI, add, subtract, multiply import * as Math from "./math.js"; console.log(Math.PI); // 3.14159 console.log(Math.add(2, 3)); // 5 console.log(Math.multiply(2, 4)); // 8 // Useful when you need many exports // or when there is a name conflict
Result
Open