GitHub - Mmabiaa/Basic-JavaScript-Programs: These are some basic JavaScript programs you can clone!
Repository navigation
Basic-JavaScript-ProgramsPublic
About
These are some basic JavaScript programs you can clone!
Topics
basic-java-programs basic-javascript basic-learning basic-programming css html5 javascriptResources
Readme MIT licenseCode of conduct
Code of conduct ActivityStars
3 starsWatchers
1 watchingForks
0 forks Report repositoryBranches
Tags
Go to Branches page Go to Tags page
Latest commit
History
13 Commits
View commit history for this file.
Folders and files
| Name | Name | Last commit message | Last commit date |
|---|---|---|---|
| Counter Program | Counter Program | ||
| QR_Code Generator | QR_Code Generator | ||
| Random Number Genearator | Random Number Genearator | ||
| sigup-login-auth | sigup-login-auth | ||
| CODE_OF_CONDUCT.md | CODE_OF_CONDUCT.md | ||
| CONTRIBUTION.md | CONTRIBUTION.md | ||
| LICENSE | LICENSE | ||
| README.md | README.md | ||
Repository files navigation
Basic JavaScript Programs
Welcome to the Basic JavaScript Programs repository! This collection contains simple JavaScript programs designed to help beginners understand fundamental programming concepts and improve their coding skills.
Table of Contents
Features
- A variety of basic programs covering topics such as:
- Variables and Data Types
- Control Structures (if statements, loops)
- Functions
- Arrays and Objects
- DOM Manipulation
- Clear and concise code with comments for better understanding.
- Easy to follow examples that can be run in any JavaScript environment.
Installation
To get started with the Basic JavaScript Programs, follow these steps:
-
Clone the repository:
git clone https://github.com/mmabiaa/Basic-JavaScript-Programs.git -
Navigate to the project directory:
cd Basic-JavaScript-Programs -
Open the HTML files in your preferred web browser or use a code editor with a live server extension.
Usage
Each program is contained within its own file. You can run any of the JavaScript files by including them in an HTML document or executing them in a JavaScript console. Here's how you can include a JavaScript file in an HTML document:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>JavaScript Program</title> <script src="path/to/your/javascript-file.js"></script> </head> <body> <h1>Welcome to My JavaScript Program</h1> </body> </html>
Examples
Here are a few examples of what you can find in this repository:
Hello World: A simple program that prints "Hello, World!" to the console.
console.log("Hello, World!");
Factorial Calculation: A function that calculates the factorial of a number.
text
function factorial(n) {
if (n === 0) return 1;
return n * factorial(n - 1);
}
console.log(factorial(5)); // Output: 120
Array Manipulation: Demonstrating how to add, remove, and iterate through arrays.
let fruits = ['apple', 'banana', 'orange'];
fruits.push('grape'); // Add an element
fruits.splice(1, 1); // Remove 'banana'
fruits.forEach(fruit => {
console.log(fruit);
});
Contributing
Contributions are welcome! If you have suggestions for improvements or new programs to add, please view CONTRIBUTION FILE .
License
This project is licensed under the MIT License - see the LICENSE file for details.
About
These are some basic JavaScript programs you can clone!