Last active
March 15, 2021 07:53
-
-
Save NovoManu/74b0a0866a2b72fb81fd4099dd4b0f2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lib.js | |
export const PI = Math.PI | |
const sum = (a, b) => a + b | |
export default sum | |
// file.js | |
import sum, { PI } from 'lib.js' | |
console.log(sum(1, PI)) // Expected output: 4.141592654 | |
// lib2.js | |
export * from 'lib.js' | |
export const e = Math.E | |
export const ln = x => Math.log(x) | |
//file2.js | |
import * as ma from 'lib2.js' | |
console.log(ma.ln(ma.e)) // Expected output: 1 | |
console.log(sum(1, PI)) // Expected output: 4.141592654 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment