<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Modules</h1>
<script type="module" src="app.js"></script>
</body>
</html>
export const greet = (name) => {
return `Hello, ${name}!`;
};
import { greet } from './file1.js';
const aa = (function () {
const message1 = greet('John 2');
return {
message1
}
})();
export default aa;
import { greet } from './file1.js';
import aa from "./file2.js";
const bb = (function () {
const message2 = greet('John 3') + aa.message1;
return {
message2
}
})();
export default bb;
import bb from "./file3.js";
console.log(bb.message2)