Setting Up Your Environment
To start coding in JavaScript, you need the following tools:
Web Browser: Modern browsers like Chrome, Firefox, or Edge.
Text Editor/IDE: VS Code, Sublime Text, or any editor of your choice.
Writing Your First Script
Create an index.html file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScript Example</title>
</head>
<body>
<h1>Welcome to JavaScript</h1>
<script>
console.log("Hello, JavaScript!");
</script>
</body>
</html>
Open this file in your browser, and check the developer console to see the output.