https://github.com/mmabiaa/basic-javascript-programs
These are some basic JavaScript programs you can clone!
https://github.com/mmabiaa/basic-javascript-programs
basic-java-programs basic-javascript basic-learning basic-programming css html5 javascript
Last synced: 9 months ago
JSON representation
These are some basic JavaScript programs you can clone!
- Host: GitHub
- URL: https://github.com/mmabiaa/basic-javascript-programs
- Owner: Mmabiaa
- License: mit
- Created: 2024-12-06T14:41:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-19T20:26:31.000Z (11 months ago)
- Last Synced: 2025-02-07T17:37:10.713Z (11 months ago)
- Topics: basic-java-programs, basic-javascript, basic-learning, basic-programming, css, html5, javascript
- Language: CSS
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 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](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)
## 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:
1. Clone the repository:
`git clone https://github.com/mmabiaa/Basic-JavaScript-Programs.git`
2. Navigate to the project directory:
`cd Basic-JavaScript-Programs`
3. 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:
```
JavaScript Program
Welcome to My JavaScript Program
```
## 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](CONTRIBUTION.md).
## License
This project is licensed under the MIT License - see the [LICENSE file](LINCENSE.md) for details.