JavaScript is the programming language of the web. It runs on browsers, servers (Node.js), and mobile devices. Mastering fundamentals is your first step toward becoming a web developer!
Below is a simple example of JavaScript changing HTML content dynamically. Click the buttons to turn the light bulb on and off!
JavaScript can change HTML attribute values.
In this case JavaScript changes the value of the src (source) attribute of an image.
This example uses JavaScript to:
getElementById('myImage'))src attribute) when buttons are clickedonclick event)This is just a small taste of what JavaScript can do. Throughout this course, you'll learn how to create much more complex and interactive web applications!
To become a web developer, follow these steps in order:
Create your first web page with the standard markup language for web content.
Style your web page with beautiful colors, fonts, and layouts.
Make your web pages dynamic and interactive for users.
After mastering HTML, CSS, and JavaScript, you can publish your website for the world to see!
Client-side - How a web page looks
Hello, Front-End Developer!
Server-side - How a web page works
Manages data and business logic
Full-Stack Developers work with both frontend and backend technologies!
# Open PowerShell as Administrator
# Navigate to your working directory
cd Documents
mkdir javascript-course
cd javascript-course
mkdir presentation1
cd presentation1
# Create your first JavaScript file
echo "console.log('Hello World!');" > app.js
# Run with Node.js
node app.js
For quick testing, use jseditor.io - no setup required!
Open jseditor.io and try this code:
// Presentation 1 - Basic JavaScript
console.log("=== JavaScript Fundamentals ===");
console.log("Hello World! 🌍");
console.log("Welcome to JavaScript Programming!");
// Basic calculations
console.log("2 + 2 = " + (2 + 2));
console.log("10 * 5 = " + (10 * 5));
console.log("100 / 4 = " + (100 / 4));
// String concatenation
console.log("Hello " + "there " + "friend!");
💡 Tip: The console.log() function prints output to the console.
Create a program that displays your personal information:
// Lab Exercise: Personal Profile
console.log("=== Personal Profile ===");
// Your personal information
const firstName = "Maria";
const lastName = "Johnson";
const age = 22;
const occupation = "Web Developer";
const favoriteLanguage = "JavaScript";
// Display the information
console.log("Full Name: " + firstName + " " + lastName);
console.log("Age: " + age);
console.log("Occupation: " + occupation);
console.log("Favorite Programming Language: " + favoriteLanguage);
console.log(" ");
console.log("Nice to meet you! 😊");
// Calculate years until 30
const yearsUntil30 = 30 - age;
console.log("Years until 30: " + yearsUntil30);
✅ Challenge: Add more personal information and calculations!
# Initialize git in your project folder
git init
# Check the status of your files
git status
# Add all files to staging
git add .
# Commit your changes with a message
git commit -m "Completed Presentation 1: JavaScript fundamentals"
# Push to gitea.techshare.cc (replace with your repo)
git remote add origin https://gitea.techshare.cc/your-username/js-course.git
git branch -M main
git push -u origin main
🚀 Next Session: Operators, Arrays, and more data manipulation!