Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren+ 2
What is module in typescript?
what is module in typescript explain with example?
4 Antworten
+ 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