JS Modules: 01. Without module
by istiq20
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Without Module</title>
<script src="scripts/library.js"></script>
</head>
<body>
<script>
sayHello("Eko"); // Hello Eko
sayGoodBye("Eko"); // Good Bye Eko
console.info(name); //Eko
</script>
</body>
</html>
JavaScript
function sayHello(name) {
console.info(`Hello ${name}`);
}
function sayGoodBye(name) {
console.info(`Good Bye ${name}`);
}
const name = "Eko";