showing results for - "es6 features in javascript"
Lucia
18 Jun 2017
1// lib/math.js
2export function sum(x, y) {
3  return x + y;
4}
5export var pi = 3.141593;
Lisa
29 Feb 2020
1// lib/mathplusplus.js
2export * from "lib/math";
3export var e = 2.71828182846;
4export default function(x) {
5    return Math.log(x);
6}
Andrea
26 May 2016
1// app.js
2import * as math from "lib/math";
3alert("2π = " + math.sum(math.pi, math.pi));
Irene
14 Apr 2017
1// app.js
2import ln, {pi, e} from "lib/mathplusplus";
3alert("2π = " + ln(e)*pi*2);
Alice
09 Jul 2018
1// otherApp.js
2import {sum, pi} from "lib/math";
3alert("2π = " + sum(pi, pi));