Hello World
A simple Hello World script to get started with JavaScript. Perfect for beginners learning the basics.
Code
// Hello World Script
console.log('Hello, World!');
function greet(name) {
return `Hello, ${name}!`;
}
// Test the function
const message = greet('Noxy');
console.log(message);
// Display in browser
document.body.innerHTML = `
<div style="
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: system-ui;
font-size: 3rem;
">
${message}
</div>
`;
Usage
- Copy the code above
- Open your browser console
- Paste and run
- See the greeting!
Read other prompts