A comprehensive collection of JavaScript projects and exercises documenting my journey from fundamentals to advanced concepts. This repository contains 15+ days of hands-on learning, covering everything from basic syntax to complex web applications with API integration.
javascript-learning/
โโโ Day 1/ # JavaScript Basics & Utilities
โโโ Day 2/ # Functions & Closures
โโโ Day 3/ # Arrays & Methods
โโโ Day 4/ # Objects Deep Dive
โโโ Day 5/ # Classes & Prototypes
โโโ Day 6/ # DOM Manipulation
โโโ Day 7/ # Calculator Project
โโโ Day 8/ # Todo App (Combined Version)
โโโ Day 9/ # Todo App (Modular Version)
โโโ Day 10/ # Internationalization & Regex
โโโ Day 11/ # Async JS I - Promises
โโโ Day 12/ # Async JS II - Async/Await
โโโ Day 13/ # Fetch API & HTTP Methods
โโโ Day 14/ # State Management Pattern
โโโ Day 15/ # GitHub User Search App
A fully functional calculator with advanced features:
- Basic arithmetic operations (+, -, *, /, %)
- Parentheses support for complex expressions
- Smart input handling (prevents multiple zeros, handles decimals)
- Theme Toggle: Light/Dark mode with localStorage persistence
- Keyboard Support: Full keyboard navigation
- Math.js Integration: Reliable expression evaluation
Tech Stack: HTML5, CSS3, Vanilla JavaScript, Math.js
A modern task management application with two implementations:
Day 8: Monolithic version with all logic in one file
Day 9: Modular version with separated concerns
Features:
- Add, toggle, and delete todos
- Filter by All/Active/Completed
- Task counter with smart pluralization
- LocalStorage persistence
- Keyboard shortcuts (Enter to add)
- Clean, responsive UI
Tech Stack: HTML5, CSS3, ES6 Modules
A professional GitHub user search application with pagination and detailed profiles:
Features:
- Real-time GitHub user search
- Paginated results (12 users per page)
- Detailed user profiles in modal view
- Loading states and error handling
- YouTube-style clear button
- State persistence across refreshes
- ESC key modal close
- Fully responsive design
Tech Stack: HTML5, CSS3, ES6 Modules, GitHub REST API, localStorage
- String manipulation (
reverse
,split
,join
) - Type checking with
typeof
- Array operations (
sumArray
,countVowels
) - String methods:
trim()
,slice()
,includes()
,split()
- Closures: Private state management with
makeCounter()
- IIFE: Immediately Invoked Function Expressions
- this keyword:
call()
,apply()
,bind()
- Higher-order functions
Basics (Day 3a):
- CRUD operations
push
,pop
,shift
,unshift
slice
vssplice
Array.from()
,for...of
loops- Custom utilities:
chunk()
,flattenOneLevel()
Advanced (Day 3b):
map()
: Transform arraysfilter()
: Conditional selectionreduce()
: Aggregation and transformationfind()
,some()
,every()
sort()
: Custom sorting logicgroupBy()
: Data organization
- Object literals and nested objects
- Dot vs bracket notation
- Destructuring and rest/spread operators
- Shallow vs deep copying (
structuredClone
) Object.keys()
,Object.values()
,Object.entries()
- Prototypal inheritance with
Object.create()
- Optional chaining (
?.
) and nullish coalescing (??
) - Safe nested property access
- Prototypal inheritance
- ES6 Classes and constructors
- Class inheritance with
extends
- Factory functions vs Classes
instanceof
operator- Timer Project: Multiple implementations
- Basic class-based timer
- Factory function timer
- Advanced timer with pause/resume
Key Reflection: Classes provide better ergonomics for larger projects with inheritance needs, while factory functions work well for single-use cases.
- Selectors:
querySelector
,querySelectorAll
- Creating and inserting elements
innerHTML
vstextContent
- Attributes:
getAttribute()
,setAttribute()
classList
manipulation- Inline styles with
.style
dataset
API for data attributes
- Event object properties
- Event bubbling vs capturing
- Event delegation for dynamic elements
- Form validation with
preventDefault()
- Keyboard event handling
- Practical: Login form with validation
Date
object and methodsIntl.DateTimeFormat
for localized datesIntl.NumberFormat
for currency formatting- Regex patterns for validation:
- Username validation:
/^[a-zA-Z0-9]{3,12}$/
- Website validation with domain checking
- Username validation:
- Date formatting across locales (UK, German, Japanese, Nepali)
Concepts:
- Call Stack, Web APIs, Event Loop
- Microtask vs Macrotask queues
- Promise states: Pending, Fulfilled, Rejected
.then()
,.catch()
,.finally()
- Promise chaining
Exercises:
- Wrapping
setTimeout
in promises - Event loop execution order
- Simulated login flow:
loginUser
โfetchProfile
โfetchPosts
Features:
async
/await
syntaxtry
/catch
/finally
blocks- Promise Combinators:
Promise.all()
: All or nothingPromise.race()
: First to finish winsPromise.allSettled()
: All results, no rejectionPromise.any()
: First success matters
- AbortController: Cancel fetch requests
- Timeout implementation with auto-abort
Core Topics:
- GET requests with error handling
- POST, PUT, DELETE operations
- HTTP headers and JSON payloads
- Status code handling
- CORS basics
- Rate limiting awareness
- Pagination with query parameters
Advanced Patterns:
- Exponential backoff retry logic
- Request/response headers inspection
- Real API examples with JSONPlaceholder
- Centralized state pattern
- Immutable state updates
- Re-rendering on state changes
- Keyboard shortcut integration
- Counter example with multiple operations
Category | Technologies |
---|---|
Languages | JavaScript (ES6+), HTML5, CSS3 |
APIs | GitHub REST API, JSONPlaceholder |
Libraries | Math.js (calculator expressions) |
Storage | LocalStorage API |
Concepts | Promises, Async/Await, Fetch API, ES6 Modules |
Tools | Browser DevTools, Regex, Intl API |
- A modern web browser (Chrome, Firefox, Safari, Edge)
- Basic understanding of HTML/CSS (for understanding the code)
- Clone the repository:
git clone https://github.com/Praagya007/Learning-JavaScript.git
cd javascript-learning
- Navigate to any day's project:
cd "Day 7" # Calculator
cd "Day 9" # Todo App
cd "Day 15" # GitHub Search
- Open in browser:
# macOS
open index.html
# Windows
start index.html
# Linux
xdg-open index.html
Note: Some projects (Days 9 and 15) use ES6 modules. You may need to run a local server to avoid CORS issues:
# Using Python 3
python -m http.server 8000
# Using Node.js (with http-server)
npx http-server
Then visit http://localhost:8000
Progressed from monolithic scripts (Day 8) to modular architecture (Days 9, 15):
Day 9: main.js, ui.js, storage.js
Day 15: main.js, api.js, ui.js
- Comprehensive
try
/catch
blocks - User-friendly error messages
- Loading states for async operations
- Graceful degradation
- LocalStorage for persistence
- Immutable state updates
- Centralized state in larger apps
- RESTful API consumption
- Pagination handling
- Rate limit awareness
- AbortController for request cancellation
- Keyboard shortcuts and accessibility
- Loading indicators
- Theme persistence
- Responsive design patterns
Day | Topic | Key Concepts |
---|---|---|
1 | Basics | Variables, strings, arrays, typeof |
2 | Functions | Closures, IIFE, call/apply/bind |
3 | Arrays | map, filter, reduce, sort, groupBy |
4 | Objects | Destructuring, spread, deep copy |
5 | Classes | Inheritance, prototypes, factory vs class |
6 | DOM | Selectors, events, delegation, forms |
7 | Project | Calculator with theme toggle |
8 | Project | Todo app (monolithic) |
9 | Project | Todo app (modular) |
10 | Intl/Regex | Date formatting, validation patterns |
11 | Async I | Promises, event loop, chaining |
12 | Async II | Async/await, combinators, AbortController |
13 | Fetch API | HTTP methods, headers, retry logic |
14 | State | Centralized state pattern |
15 | Project | GitHub user search with pagination |
- From Callbacks to Promises to Async/Await: Understanding JavaScript's evolution in handling asynchronous code
- Event Loop Mastery: Deep understanding of microtasks vs macrotasks
- Module Systems: Transitioning from global scope to ES6 modules
- API Design: Separation of concerns (UI, API, Storage)
- โ Always validate user input
- โ Handle errors gracefully with user feedback
- โ Use semantic HTML and meaningful class names
- โ Implement keyboard shortcuts for better UX
- โ Persist user preferences with localStorage
- โ Write modular, reusable code
- โ Document learning journey and challenges
- โ Direct DOM manipulation without state management
- โ Callback hell (solved with Promises/Async)
- โ Ignoring error states
- โ Forgetting to clean up event listeners
- โ Mixing business logic with UI code
- Add TypeScript to existing projects
- Implement unit tests with Jest
- Add dark mode to all projects
- Improve accessibility (ARIA labels, keyboard nav)
- Add input debouncing to search functionality
- Build a full-stack app with Node.js backend
- Learn React and rebuild projects as components
- Implement advanced state management (Redux/Zustand)
- Add GraphQL API integration
- Deploy projects to production (Vercel/Netlify)
This is a personal learning repository, but suggestions and feedback are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement
) - Commit your changes (
git commit -m 'Add some improvement'
) - Push to the branch (
git push origin feature/improvement
) - Open a Pull Request
This project is open source and available under the MIT License.
- JSONPlaceholder: For providing a free REST API for testing
- GitHub API: For enabling the user search project
- Math.js: For robust mathematical expression evaluation
- MDN Web Docs: For comprehensive JavaScript documentation
- The JavaScript Community: For creating excellent learning resources
- GitHub: @praagya007
- Email: praagyadevkota@gmail.com
Built with โค๏ธ and lots of โ while learning JavaScript
โญ Star this repo if you find it helpful!