What is JavaScript?
What is JavaScript?
JavaScript is a high-level, interpreted programming language primarily used for web development. It adds interactivity to websites through client-side scripting.
First JavaScript Program
<!DOCTYPE html>
<html>
<head>
<title>My First JS</title>
</head>
<body>
<h1></h1>
<script>
console.log("Hello, World!");
document.querySelector("h1").textContent = "Hello JavaScript!";
</script>
</body>
</html>Key Points
- JavaScript runs in browser (client-side) or Node.js (server-side).
- <code><script></code> tags or external .js files.
- console.log() for debugging.
- Manipulates DOM via document object.