[Sparta Coding Club] Week 2 — Today I learned
2 min readFeb 18, 2024
Key Concepts Learned Today:
- JavaScript:
- Explored closures in JavaScript and how they allow functions to retain access to their lexical scope even after the parent function has finished executing.
- Delved into the ES6 features such as arrow functions, template literals, and destructuring assignments, enhancing code readability and conciseness.
- Learned about the importance of event delegation in JavaScript, optimizing performance by attaching event listeners to parent elements rather than individual child elements.
- AJAX (Asynchronous JavaScript and XML):
- Implemented AJAX requests using the Fetch API, discovering its simplicity and power in making asynchronous HTTP requests and handling responses.
- Explored techniques for handling AJAX loading indicators and error messages, providing users with feedback during data fetching processes.
- Learned about CORS (Cross-Origin Resource Sharing) and its implications for AJAX requests, understanding how to configure servers to allow cross-origin requests securely.
- JSON (JavaScript Object Notation):
- Delved into JSON Schema and its role in defining the structure and validation rules for JSON data, ensuring consistency and integrity across web applications.
- Explored techniques for parsing and serializing JSON data in JavaScript, including error handling and best practices for dealing with invalid JSON syntax.
- Learned about the potential security risks associated with JSONP (JSON with Padding) and explored alternatives for cross-domain data communication.
What I Want to Try Next:
- Experiment with implementing more complex AJAX functionalities, such as pagination, filtering, and sorting, to enhance user interactions and data presentation in web applications.
- Dive deeper into advanced JavaScript topics like Promises, Async/Await, and modular JavaScript patterns to improve code organization and maintainability.
- Explore real-world applications of JSON Web Tokens (JWT) for authentication and authorization in web development, understanding their role in securing API endpoints and user data.
What Went Well or Wrong:
- Went well: Successfully implemented basic AJAX functionality to fetch and display data from external APIs, gaining a better understanding of asynchronous programming in JavaScript.
- What went wrong: Encountered challenges with cross-origin issues when making AJAX requests to external APIs without proper CORS configuration, leading to unexpected errors and debugging efforts. Moving forward, I’ll prioritize addressing CORS-related issues proactively to ensure smoother data integration and application performance.