+ 2
What is module in typescript?
what is module in typescript explain with example?
4 odpowiedzi
+ 5
You’re welcome ;)
+ 3
Another example:
file1.js
export const sum = (a, b) => a + b;
export const mult = (a, b) => a * b;
file2.js
import {sum} from “./file1.js”;
sum(5, 9);
+ 2
file1.js
const someFunction = () => {
// doSomething;
}
export default someFunction;
file2.js
import doNothing from “./file1.js”
doNothing();
In this case file1 is a module, which we import in file2
0
"In this case file1 is a module, which we import in file2"
ok got it ! really thanks