*
Previous Javascript-Quiz Linking JavaScript (JS) to HTML Next

JavaScript Introduction and setup

Welcome to the course “Mastering JavaScript: From Zero to Real-World Projects”. In this first lesson, you’ll set up your environment and run your first JavaScript.

What you'll learn

  • What JavaScript is and where it’s used
  • How to set up your development environment
  • How to write and run your first JavaScript program
  • How to link JavaScript to an HTML page

Why this course

Most beginners learn syntax but struggle to build real projects. This course is project-driven: every module includes a mini project so you learn by doing and end with a real portfolio app.

📘 What is JavaScript?

🕰️ A Brief History

1995 → Brendan Eich created JavaScript in just 10 days while working at Netscape.

Originally called Mocha, then LiveScript, and finally renamed JavaScript (partly to ride on Java’s popularity at the time).

1997 → Standardized as ECMAScript by ECMA International.

Through the late 1990s, JavaScript became the go-to language for adding interactivity to web pages.

2009 → The release of Node.js allowed JavaScript to run on servers, not just browsers.

Today, JavaScript is one of the most widely used programming languages in the world, powering everything from websites to AI experiments.

🌍 Use Cases of JavaScript

  1. Web Development (Front-End)

    Core language of the web, alongside HTML and CSS.

    Used to create interactive features: dropdown menus, animations, form validation, dynamic content.

    Popular frameworks: React, Angular, Vue.

  2. Server-Side Development

    With Node.js, JavaScript can build scalable back-end applications.

    Used by companies like Netflix, Uber, and PayPal.

    Frameworks: Express.js, NestJS.

  3. Mobile App Development

    Cross-platform apps using React Native, Ionic, or NativeScript.

    One codebase → runs on both Android and iOS.

  4. Desktop Applications

    Tools like Electron.js let developers build desktop apps with web technologies.

    Examples: VS Code, Slack, Discord.

  5. Game Development

    JavaScript + HTML5 Canvas or WebGL for browser games.

    Libraries: Phaser.js, Three.js.

  6. AI & Data Science

    While Python dominates AI, JavaScript has growing libraries:

    TensorFlow.js → Machine learning in the browser.

    Brain.js → Neural networks in JavaScript.

    Useful for lightweight AI apps, demos, and interactive ML visualizations.

  7. IoT & Robotics

    Frameworks like Johnny-Five let you control hardware with JavaScript.

    Used in smart devices, sensors, and robotics projects.

✨ Why JavaScript Matters

  • Universal → Runs in every browser, on servers, and even on devices.
  • Beginner-friendly → Easy to start with, yet powerful enough for advanced apps.
  • Massive ecosystem → Thousands of libraries, frameworks, and community support.

📘 Setting up the Environment for JavaScript

JavaScript can run in different environments. The most common ones are:

  • Browser Console (quick testing)
  • VS Code (coding editor)
  • Node.js (server-side runtime)

1️⃣ Browser Console (Quick Testing)

Every modern browser (Chrome, Firefox, Edge, Safari) has a built-in JavaScript engine. You can test JavaScript directly in the Console.

Steps (Chrome as example):

  1. Open Chrome.
  2. Press F12 or Right-click → Inspect → Go to Console tab.
  3. Type JavaScript code, e.g.:
console.log("Hello, World!");
2 + 2

✅ Best for: Quick experiments, debugging web pages.

2️⃣ VS Code (Coding Editor)

Visual Studio Code is the most popular editor for JavaScript.

Steps to set up:

  1. Download & Install VS Code.
  2. Create a folder for your project (e.g., my-js-project).
  3. Inside the folder, create a file: script.js.
  4. Write some code:
console.log("Running JavaScript in VS Code!");
  1. Open the file in VS Code.
  2. You can run it in:
    • Browser (by linking the JS file in an HTML page).
    • Or Node.js (see below).

✅ Best for: Writing structured projects with multiple files.

3️⃣ Node.js (Server-Side JavaScript)

Node.js lets you run JavaScript outside the browser (on your computer/server).

Steps to set up:

  1. Download Node.js from nodejs.org (choose LTS version).
  2. Install it → confirm by running in terminal/cmd:
node -v
npm -v

(Shows Node.js and npm versions.)

  1. Create app.js and write:
console.log("Hello from Node.js!");

Run in terminal:

node app.js

✅ Best for: Back-end apps, APIs, automation scripts.

🎯 Quick Recap

  • Browser Console → Quick testing.
  • VS Code → Writing and editing JavaScript projects.
  • Node.js → Running JavaScript outside the browser (server-side & tools).
Back to Index
Previous Javascript-Quiz Linking JavaScript (JS) to HTML Next
*
*