Jul 4, 2024
console.log('Hello World');
alert('Yo');
<script>
at the end of the <body>
to avoid blocking rendering.let
for variables with changing values.const
for values that shouldn't change.function greet(name) {
console.log('Hello ' + name);
}
greet('John');
function square(number) {
return number * number;
};
console.log(square(2)); // Outputs: 4