This repository contains a collection of JavaScript examples and exercises, likely from a 30-day coding challenge. It covers a wide range of JavaScript topics, from fundamental concepts to more advanced features. There is also a TypeScript file exploring functions.
The JavaScript files in this repository cover the following topics:
- Basics (variables, data types, console output)
- Strings and string manipulation
- Operators and Date object
- Conditionals (if/else, switch)
- Arrays
- Loops (for, while, do...while)
- Functions (declaration, expression, arrow, HOFs)
- Objects
- Classes (ES6 style and traditional
js7bClasses.js
) - Sets and Maps
- Destructuring and Spreading
- Regular Expressions
- Console Object methods
- Error Handling
- JSON
- Promises and Asynchronous JavaScript
- Document Object Model (DOM) manipulation
- Event Listeners
- New JavaScript Features (unspecified, from
js19NewFeatures.js
) - Best Practices
- One-Liners
- Code Snippets
- Tips & Tricks
Additionally, there is a TypeScript file:
ts1Functions.ts
: Explores functions in TypeScript.
- Clone the repository:
git clone <repository-url>
- Navigate to the directory:
cd <repository-name>
- Run the JavaScript files:
Most of the
.js
files can be run directly using Node.js:For files involving DOM manipulation (e.g.,node <filename>.js
js17DOM.js
,js18EventListeners.js
), you will need to open an HTML file that includes the script in a web browser. - Run the TypeScript file:
You'll need the TypeScript compiler (
tsc
) installed.tsc ts1Functions.ts node ts1Functions.js
Contributions are welcome! If you have improvements, new examples, or find any issues, feel free to:
- Fork the repository.
- Create a new branch for your changes.
- Make your changes, including clear comments.
- Submit a pull request for review.