1. Introduction to Modern JavaScript
JavaScript is the programming language of the web. It drives client-side interactivity, asynchronous APIs, DOM modifications, and server-side runtimes via Node.js.
⊞HTML5 Web Code (index.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript Basics</title>
</head>
<body style="background:#17181c; color:#fff; font-family:Arial; padding:30px;">
<h2>JavaScript Console Output</h2>
<p id="output-text">Check browser DevTools console (F12) or see below:</p>
<div id="demo-box" style="padding:15px; background:#1f2029; border-left:4px solid #04AA6D; margin-top:15px;"></div>
<script>
// 1. Variable Declarations
const platformName = "Nextsem Academy";
let activeStudents = 1500;
const isFree = true;
// 2. Logging and Displaying
console.log("Welcome to " + platformName + "!");
console.log("Active learners:", activeStudents);
// 3. Injecting to UI
document.getElementById("demo-box").innerHTML =
"<strong>Platform:</strong> " + platformName + "<br>" +
"<strong>Students:</strong> " + activeStudents + "<br>" +
"<strong>100% Free:</strong> " + isFree;
</script>
</body>
</html>
2. Primitive vs Non-Primitive Data Types
| Data Type | Example | Description |
|---|---|---|
| String | "Nextsem", 'Code' | Text sequences enclosed in quotes |
| Number | 42, 3.14159 | Integers and floating-point decimals |
| Boolean | true / false | Logical condition flags |
| Null | null | Intentional absence of any object value |
| Undefined | undefined | Variable declared but not assigned |
| Object | { name: "Dev" } | Key-value mapping collection |
| Array | [1, 2, 3] | Ordered index-based list |
