Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------ lib.js ------
- export const sqrt = Math.sqrt;
- export function square(x) {
- return x * x;
- }
- export function diag(x, y) {
- return sqrt(square(x) + square(y));
- }
- //------ main.js ------
- import { square, diag } from 'lib';
- console.log(square(11)); // 121
- console.log(diag(4, 3)); // 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement