Modules

Not been supported now supported now

With AMD/CommonJS spcification

Like python

math.js

let sum = (x, y) => {
    return x + y;
};

const PI = 3.141593;

export {sum, PI};

Main.js

import * as math form "./math";
console.log(math.sum(1, 2));

import { PI as t } from "./math";
console.log(t);

results matching ""

    No results matching ""